Note that there are some explanatory texts on larger screens.

plurals
  1. PODirectX 9 C++ program crashes and wont re-open
    primarykey
    data
    text
    <p>I am just beginning to learn how to program DirectX 9 applications in C++, so I'm still not very good, and I'm messing it around quite a bit.</p> <p>When I reopen the program after it crashes, the D3D Device fails to create with the result being <strong>D3DERR_INVALIDCALL</strong>. I am compiling with G++ in MinGW, using the DirectX August 2009 SDK. I'm guessing it's because I didnt release all the Devices and Textures etc when it crashes, and it still thinks I'm using them. It re-opens on a restart. Would someone be able to point me in the right direction as to how to sortof "reset" DirectX?</p> <p>Here is what I am using to create the device:</p> <pre><code>D3D = Direct3DCreate9(D3D_SDK_VERSION); D3DPRESENT_PARAMETERS D3DPP; ZeroMemory(&amp;D3DPP, sizeof(D3DPP)); D3DPP.Windowed = TRUE; D3DPP.SwapEffect = D3DSWAPEFFECT_DISCARD; D3DPP.hDeviceWindow = hWnd; D3DPP.BackBufferFormat = D3DFMT_X8R8G8B8; D3DPP.BackBufferWidth = WIDTH; D3DPP.BackBufferHeight = HEIGHT; D3DDevice = 0; //Null pointer to make sure I can check it HRESULT hr = D3D-&gt;CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &amp;D3DPP, &amp;D3DDevice); if (!D3DDevice) { MessageBox(NULL,"Device could not be created","error",0); switch (hr) { case D3DERR_DEVICELOST: MessageBox(NULL,"1","error",0); break; case D3DERR_INVALIDCALL: MessageBox(NULL,"2","error",0); break; case D3DERR_NOTAVAILABLE: MessageBox(NULL,"3","error",0); break; case D3DERR_OUTOFVIDEOMEMORY: MessageBox(NULL,"4","error",0); break; }; return 1; }; return 0; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload