I recently started working with Direct3D 11, but I am having some problems with initializing it.
The code below failes on the last line. It returns the following hr: -2005270527.
I have tried to use GetLastError and then use HRESULT_FROM_WIN32, and I get the following error: "The specified module could not be found."
I know I can use D3D11CreateDeviceAndSwapChain, but I need the IDXGIFactory to disable ALT-ENTER.
Can someone please tell me what is wrong with the following code.
It worked with Direct3D 10 and the only difference is D3D11CreateDevice instead of D3D10CreateDevice.
I did found some return codes here that I was not comparing my hr with, but none of the return codes equals to my hr.
I finally found out what the hr is by using DXTrace. The error is DXGI_ERROR_INVALID_CALL.
I went to the msdn site and there I found that I would get this error when pDesc or ppSwapChain is NULL.
My SwapChain is NULL when calling the function, but isn't this supposed to be?
How do you declare SwapChain?
[/quote]
IDXGISwapChain SwapChain;
SwapChain = NULL;
I already tried to don't make it NULL, but it has the same result.
I did however find a way to make my code work by replacing CreateDXGIFactory with:
IDXGIDevice* pDXGIDevice;
Device->QueryInterface(__uuidof(IDXGIDevice), (void **)&pDXGIDevice);