Perform the ALT+TAB (DX9)
HI !
When i call the reset method a directx9 device, I've got a INVALIDCALL error message. however, i fill the D3DPRESENT_PARAMETERS parameter with the same value i took when i created the device. I have try all solution. Please help me !=)
ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.BackBufferWidth = pMode.Width;
d3dpp.BackBufferHeight = pMode.Height;
d3dpp.BackBufferFormat = format_rendertarget;
d3dpp.AutoDepthStencilFormat = format_depthstencil;
d3dpp.Windowed = FALSE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferCount = 3;
d3dpp.hDeviceWindow = hWnd;
d3dpp.FullScreen_RefreshRateInHz = pMode.RefreshRate;
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
d3dpp.EnableAutoDepthStencil = TRUE;
Thank you.
[Edited by - Woodchuck on October 10, 2004 9:24:14 PM]
Use the control panel to enable the DirectX D3D debug runtimes. The output window in VStudio, or dbMon in the platform SDK, or The DebugView will then likely show you exactly what D3D didn't like.
I'm curious as to why you have 3 backbuffers. Most games use 1, some people swear by triple buffering and set 2 (the 3rd buffer is the front buffer). I can't think of a good reason to need 3.
edit: Also, are you sure the device is back in DEVICENOTRESET mode and not still in DEVICELOST mode? Use TestCooperativeLevel() to find out whether it's okay to reset yet or not.
I'm curious as to why you have 3 backbuffers. Most games use 1, some people swear by triple buffering and set 2 (the 3rd buffer is the front buffer). I can't think of a good reason to need 3.
edit: Also, are you sure the device is back in DEVICENOTRESET mode and not still in DEVICELOST mode? Use TestCooperativeLevel() to find out whether it's okay to reset yet or not.
Quote:Original post by Namethatnobodyelsetook
I'm curious as to why you have 3 backbuffers. Most games use 1, some people swear by triple buffering and set 2 (the 3rd buffer is the front buffer). I can't think of a good reason to need 3.
edit: Also, are you sure the device is back in DEVICENOTRESET mode and not still in DEVICELOST mode? Use TestCooperativeLevel() to find out whether it's okay to reset yet or not.
edit : yes.
I have 3 backbuffer because ... mmhh .. because ... i don't remember why :)
Thank You ! I'm going to look at the control panel.
Oh, and be aware that the control panel options for DirectX only appear if your SDK is the same as the latest retail version installed. ie: If you installed DX9.0 SDK, but then installed, say Sims 2 which installs the DX9.0c runtimes, you won't get the control panel options.
Thank you for the advise. I really don't arrive to check the problem even with a debug run time.
INVALID CALL always. All value seems to be correct... I don't understand because i put the same value that in the create method (which perform well). I try to re-use out value of the create method. Same error. I try to not specified any value. I try to pass NULL, it was not a good idea=) And i read and read the documentation especially about lost device. there is only one remark odd. ...
"When switching to full-screen mode, Microsoft® Direct3D® will try to find a desktop format that matches the back buffer format, so that back buffer and front buffer formats will be identical (to eliminate the need for color conversion).
"
Don't understand but i think it concern only Microsoft® Direct3D® =)
:(
INVALID CALL always. All value seems to be correct... I don't understand because i put the same value that in the create method (which perform well). I try to re-use out value of the create method. Same error. I try to not specified any value. I try to pass NULL, it was not a good idea=) And i read and read the documentation especially about lost device. there is only one remark odd. ...
"When switching to full-screen mode, Microsoft® Direct3D® will try to find a desktop format that matches the back buffer format, so that back buffer and front buffer formats will be identical (to eliminate the need for color conversion).
"
Don't understand but i think it concern only Microsoft® Direct3D® =)
:(
The strange comment in the documentation just means that if you specify a back buffer of A8R8G8B8, it will try to find a matching screen format... X8R8G8B8. Or atleast that's the only thing I know D3D does that fits with that comment.
Are you destroying your window and creating a new one, or just reusing your window? You MUST use the same window (remember that CreateDevice() took an hWnd too). The HWND passed to CreateDevice must be a top level window. The HWND specified in present params can be the same window, or a child window.
Check what your pMode and format_rendertarget and format_depthstencil values contain (use the debugger)... make sure everything really is as you expect it to be.
Are you destroying your window and creating a new one, or just reusing your window? You MUST use the same window (remember that CreateDevice() took an hWnd too). The HWND passed to CreateDevice must be a top level window. The HWND specified in present params can be the same window, or a child window.
Check what your pMode and format_rendertarget and format_depthstencil values contain (use the debugger)... make sure everything really is as you expect it to be.
Remember that you must manually release and re-create every resource that you've created in the default pool (in D3DPOOL_DEFAULT - search for that in your code). The device will not reset until you've released ALL such resources.
Switching to debug d3d and cranking up the warning level in the DirectX control panel will tell you which resources hasn't been released when you try to reset the device (if any).
- Kasper
Switching to debug d3d and cranking up the warning level in the DirectX control panel will tell you which resources hasn't been released when you try to reset the device (if any).
- Kasper
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement