开发者

Problems with creating a DirectX 10 device and swap chain

开发者 https://www.devze.com 2023-03-27 03:19 出处:网络
I am having some problems with creating a valid DirectX 10 device and swap chain using D3D10Create开发者_如何学GoDeviceAndSwapChain. I think it might be my window creation that something goes wrong in

I am having some problems with creating a valid DirectX 10 device and swap chain using D3D10Create开发者_如何学GoDeviceAndSwapChain. I think it might be my window creation that something goes wrong in since it says that the OutputWindow in the supplied SwapChainDesc is unused=??? (or a random int value)

This problem has been stressing me out since I can't seem to find out what is wrong with the project code

I know that it fails at line 193 in CDirect3D.cpp at

result = D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &swapChainDesc, &this->m_swapChain, &this->m_device);

I would be very grateful if someone could take a look at the code. I've uploaded the project and its sources at http://dl.dropbox.com/u/3605545/files/LearningEngine.zip

(Not a huge codebase, only 4 classes so far)

The project is in VS2010 and I used the DirectX SDK from June 2010


I found the problem, I mistyped this line:

swapChainDesc.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM;

Should have been:

swapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号