mercredi 4 mars 2015

Using D3D11CreateDeviceAndSwapChain?


I am currently writing a DirectX 11 game engine in C++ based off a tutorial, but I ran into a problem. Here is where the error is:



result = D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL,
0, &featureLevel, 1, D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain,
&m_device, NULL, &m_deviceContext);


result = HRESULT, featureLevel = D3D_FEATURE_LEVEL, swapChainDesc = DXGI_SWAP_CHAIN_DESC, m_swapChain = IDXGISwapChain*, m_device = ID3D11Device*, and finally m_deviceContext = ID3D11DeviceContext*.


When I run this, I get a value of something like -5027..., so that doesn't work. I also looked at this article to try what they had, but it ended up crashing my computer(I had modified the code a little to my varibles, ending up with D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &swapChainDesc, &m_swapChain, &m_device, &featureLevel, &m_deviceContext);).


Does anyone know how to solve this issue? I can upload my whole program to pastebin, just ask. Also, here is the link to the tutorial if you want to look over it.


Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire