[SIZE=1]
hi all,
Just a couple of random questions I have after reading Chapter 5. I know that more will be explained as I progress through the book so I'm not getting too caught up on the code just yet.
1. Is it common for a professional game to use the DirectX framework or is this just used to keep us focused on the examples?
Prior to reading this book, I did everything manually - create/register a window class and my D3D init code looked like this:
Display All
And then resizing the buffers, creating the views etc in resize().
Do professional games use DXUT or does it vary from game to game?
2. In the book it says that every Windows application starts in _tWinMain but uses wWinMain in the example. I would normally just define WinMain. Should we always define wWinMain over _tWinMain and WinMain? What's the difference?
3. Does an underscore before a function name denote anything special? Is there any time we would choose to use string objects over char arrays?
4. Is the same technique still used to calculate CPU speed? I don't know anything about assembly language or really what is happening in the code there. I skipped over it, and will probably have to skip this test, but I was just wondering if this process has gotten any easier since the book came out.
Argh! I think that best describes the mood of this post since I get frustrated easy.
[/SIZE]
hi all,
Just a couple of random questions I have after reading Chapter 5. I know that more will be explained as I progress through the book so I'm not getting too caught up on the code just yet.
1. Is it common for a professional game to use the DirectX framework or is this just used to keep us focused on the examples?
Prior to reading this book, I did everything manually - create/register a window class and my D3D init code looked like this:
Source Code
- void d3dApp::initD3D()
- {
- //1. DXGI_SWAP_CHAN_DESC
- DXGI_SWAP_CHAIN_DESC sd;
- //Back buffer dimensions and format.
- sd.BufferDesc.Width = mClientWidth;
- sd.BufferDesc.Height = mClientHeight;
- sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
- //Full screen mode options.
- sd.BufferDesc.RefreshRate.Numerator = 60;
- sd.BufferDesc.RefreshRate.Denominator = 1;
- sd.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED;
- sd.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED;
- //No multisampling.
- sd.SampleDesc.Count = 1;
- sd.SampleDesc.Quality = 0;
- sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
- sd.BufferCount = 1;
- sd.OutputWindow = hWndApp;
- sd.Windowed = true;
- sd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; //Let display driver select most efficient presentation method.
- sd.Flags = 0;
- UINT createDeviceFlags = 0;
- #if defined(DEBUG) || defined(_DEBUG)
- createDeviceFlags |= D3D10_CREATE_DEVICE_DEBUG;
- #endif
- //2. D3D10CreateDeviceAndSwapChain()
- D3D10CreateDeviceAndSwapChain(
- NULL, //Display Adapter, NULL == Use Primary Display Adapater.
- D3D10_DRIVER_TYPE_HARDWARE, //Specify D3D10_DRIVER_TYPE_REFERENCE for software implementation.
- NULL, //Software Rasterizer
- createDeviceFlags, //D3D10_CREATE_DEVICE_DEBUG (Enable debug layer, error messages to output) or 0
- D3D10_SDK_VERSION, //Never changes
- &sd, //DXGI_SWAP_CHAIN_DESC (1)
- &mSwapChain,
- &md3dDevice);
- resize();
- }
And then resizing the buffers, creating the views etc in resize().
Do professional games use DXUT or does it vary from game to game?
2. In the book it says that every Windows application starts in _tWinMain but uses wWinMain in the example. I would normally just define WinMain. Should we always define wWinMain over _tWinMain and WinMain? What's the difference?
3. Does an underscore before a function name denote anything special? Is there any time we would choose to use string objects over char arrays?
4. Is the same technique still used to calculate CPU speed? I don't know anything about assembly language or really what is happening in the code there. I skipped over it, and will probably have to skip this test, but I was just wondering if this process has gotten any easier since the book came out.
Argh! I think that best describes the mood of this post since I get frustrated easy.
[/SIZE]