Skip to main content
gamedev.net
🔒 Locked

Fullscreen reset device problem

Started by Tosh777 7 replies 2.4k views
Original Post
Tosh777
Tosh777
Hello. I recently started using fullscreen in my game written with directx and c++.
When i alt+tab and return to the game it just shows white screen, but gives no error and can even move the mouse.
When i lost device in windowed mode and then restore, everything is just fine: It pauses when its lost and when i go back it restores.
Is there anything more special in fullscreen mode restoration from lost device and if my description wasnt enough just say and i will give you some source code.
Buckeye
Buckeye
What does the Debug Runtime tell you?

Also, have you compared your methods for setting the device parameters, handling lost/reset devices, etc., to examples?

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly. You don't forget how to play when you grow old; you grow old when you forget how to play.
Tosh777
Tosh777

What does the Debug Runtime tell you?

Also, have you compared your methods for setting the device parameters, handling lost/reset devices, etc., to examples?





Debug runtime says nothing. And yes i have checked them all.
As i said in windowed mode works perfectly, but i guess in fullscreen fails to reset the device or something.

Evil Steve
Evil Steve

Debug runtime says nothing. And yes i have checked them all.
As i said in windowed mode works perfectly, but i guess in fullscreen fails to reset the device or something.
If a D3D function fails, the debug runtime WILL give you some indication in the debug spew. Do you see any output from D3D at all (E.g. "[Direct3D] Hal HWVP Device Selected" or similar)? If not, you probably don't have them set up correctly.

If you get some output from the debug runtime, but no errors, then that indicates that there aren't any D3D calls failing, and its some setup in your code that's going wrong.
Buckeye
Buckeye

[quote name='Buckeye' timestamp='1301408234' post='4791715']
What does the Debug Runtime tell you?

Also, have you compared your methods for setting the device parameters, handling lost/reset devices, etc., to examples?




Debug runtime says nothing. And yes i have checked them all.
As i said in windowed mode works perfectly, but i guess in fullscreen fails to reset the device or something.

[/quote]
If you're not getting any debug runtime messages, you need to get the debug runtime setup correctly. You should be getting quite a few D3D9 Helper and Direct3D9 messages. In the DirectX control panel, do you have the debug output level set to maximum, and Maximum Validation checked?

EDIT: ninja'd
Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly. You don't forget how to play when you grow old; you grow old when you forget how to play.
Tosh777
Tosh777
Just found something in the debug output:

D3DX: ID3DXEffect::BeginPass: Must be called between ID3DXEffect::Begin and ID3DXEffect::End
D3DX: ID3DXEffect::EndPass: EndPass called while not in a pass
D3DX: ID3DXEffect::End: Cannot be called without a preceding call to ID3DXEffect::Begin
D3DX: End called without matching Begin
I will try to fix that now.
Evil Steve
Evil Steve
Be aware that's output from D3DX, not D3D.
Tosh777
Tosh777
Ok. It really wasnt what i've expected. I tried to fix the problem from the information that the debug provided, but it was another thing.
I got scenes which i switch like menu, game, and etc. So before to switch from menu to game i invoked the onLostDevice for menu and now works. Before i was just switching from menu to game.
Can someone explain this to me? Are both scenes mixing together and the program doesnt know which on to reset when alt+tab again?
Evil Steve
Evil Steve
Calling OnLostDevice() for D3DX objects will Release() their internal resources allocated in D3DPOOL_DEFAULT (E.g. ID3DXSprite has a default pool vertex buffer internally). If you don't call OnLostDevice() for all D3DX objects before calling IDirect3DDevice9::Reset(), then the reset will fail because there are still default pool resources allocated.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.