Sign in to follow this  
auto.magician

Resuming from fullscreen loss

Recommended Posts

auto.magician    128
Hi all,

I wonder if I could ask for some advice.
I have my d3d9 app switching from full screen to windowed with no problems with releasing and restoring resources. In windowed mode, I can lose focus and regain focus no problem, but if I'm in fullscreen then say press the windows key, obviously I lose focus and the fullscreen app minimizes to show me the desktop. When I then click to get my fullscreen back, the program runs but I dont see anything at all, not even the window. The window gains focus as i have output to a debug window from the winproc when it does.

Is this ones of those situations where I have to recreate the 3D Device or am I missing something trivial.

Using pseudo code my algo works in this way :-

If Window Has Focus
{
If Reset Is Needed
{
D3D9.OnDeviceReset
Reset Is Needed = False
}
RenderFunc
Else
If Reset Is Needed = False
{
D3D9.OnDeviceLost
Reset Is Needed = True
}
}





Any help is appreciated
Thanks





Share this post


Link to post
Share on other sites
pekarn    173
A workaround is to block the windows key when in fullscreen but that won't fix the underlying problem.

How are you checking if the device needs to be reset? Are you using TestCooperativeLevel?

Share this post


Link to post
Share on other sites
auto.magician    128
Hi
Thanks for your help

I wasnt using TestCooperativeLevel. That was the problem. I am using it now and changed the algo above to incorporate it.
It works perfect now.


Thank you

Share this post


Link to post
Share on other sites

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