Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Alt+tab problem

Author
Message
Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 31st Jan 2011 13:57
Hello,
When I press alt+tab or minimize my game, when i get back to it, it won't run. Usually the screen becomes black, and nothing moves.
What can I do?

Forward thanks.
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 31st Jan 2011 14:59
i believe i've read somewhere that GDK does not handle "device lost" situation properly, and i dont think you can do anything about it (GDK should free all resources (sprites/textures...) when it detects this event, since we can't get to these resources, we can't find a way around it, like handling the event manually)

I'm not really sure, but maybe (MAYBE) deleting and re-creating all your resources might help? (it depends on the way GDK deals with them, but it's worth a try..)

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 2nd Feb 2011 12:20
Thanks Hassan
Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 2nd Feb 2011 22:36
There is a command called dbScreenInvalid which should detect when the device context has been lost. Then you probably need to re-load all resources.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 3rd Feb 2011 02:43 Edited at: 3rd Feb 2011 02:43
However, dbScreenInvalid also returns -1 if your application is windowed and you tab between windows, which isn't an instance where the media is lost, so it's not reliable. The best method I've found that doesn't involve anything outside of GDK is to load a dummy image or object and check that it still exists after dbSync and restoring everything if it gets deleted. Of course it is silly that GDK releases all media handles when the device is lost, because they are stored in managed memory.

Mistrel
Retired Moderator
18
Years of Service
User Offline
Joined: 9th Nov 2005
Location:
Posted: 4th Feb 2011 09:12 Edited at: 4th Feb 2011 09:15
PureGDK 1.1 supports recovering from an invalid render device. This feature will be supported in PureGDK 2.0 but has not yet been implemented. C++ support is provided in PureGDK 2.0 and up so keep an eye out for a future beta!

Here is an example with source code:

http://puregdk.com/files/d3d-device-callbacks.zip

You shouldn't be able to make this demo crash by invalidating the render device by hitting ctrl-alt-del, changing your screen resolution, or if the screen saver comes on.

Try THAT with DBP/DarkGDK.

Yero008
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location: Romania
Posted: 4th Feb 2011 17:09
Thanks Mistrel

Login to post a reply

Server time is: 2024-06-23 03:15:25
Your offset time is: 2024-06-23 03:15:25