Sign in to follow this  

Perform the ALT+TAB (DX9)

This topic is 4809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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® =)

:(

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

This topic is 4809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this