Hibernation

Hi Guys
I am running sdl with opengl and on a laptop if i leave my
application running and the machine goes into suspend mode/hibernate when
windows comes out of hibernation the application is black, the main loop is
running as i can exit the app by guessing where the buttons are.

Any ideas how to stop hibernation via my app or whats going wrong?

Trish

I suspect hibernation turns the video hardware off, meaning it drops all
textures and needs reinitialization when the machine wakes up. Video mode,
contexts etc are restored, but textures aren’t backed up anywhere, so
applications will have to reload them. (Depends on APIs of course, but IIRC,
this is the deal for most implementations of OpenGL, as well as Direct3D.)

In a perfect world, you’d get some kind of event that tells you about this,
but I’m not sure about SDL and hibernation/“wake up”…

Do you handle SDL_VIDEOEXPOSE and SDL_ACTIVEEVENT?

Does glIsTexture() return false for textures lost this way? (If so, is it
reliable across OpenGL implementations?)

Maybe glGetError() will indicate something?On Sunday 15 November 2009, at 11.33.35, Patricia Curtis <patricia.curtis at unboxedgames.com> wrote:

Hi Guys
I am running sdl with opengl and on a laptop if i leave my
application running and the machine goes into suspend mode/hibernate when
windows comes out of hibernation the application is black, the main loop is
running as i can exit the app by guessing where the buttons are.

Any ideas how to stop hibernation via my app or whats going wrong?


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’