Fullscreen alt tabbing

Sorry to bother people again, but I didn’t get any replies to this last
time, and I can’t find it on the web site.

Under Windows, when you lose focus on a full screen SDL application that
uses hardware surfaces, the surfaces can become lost.
How do I check if they have been lost?

Do I set up a thread and check for an event, and if that event arrives
reload my images?

Thanks for any help,

Rob_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Under Windows, when you lose focus on a full screen SDL application
that
uses hardware surfaces, the surfaces can become lost.
How do I check if they have been lost?

In the docs for ‘SDL_BlitSurface’:

“If either of the surfaces were in video memory, and the blit
returns -2, the video memory was lost, so it should be reloaded with
artwork and re-blitted.”

It also gives a short example.

There may be other ways of detecting lost surfaces, but that is the one
that I noticed.From: trinitychaos50@hotmail.com (Robert Clayton)
Subject: [SDL] fullscreen alt tabbing


Ben Sizer

Thanks a heap.
Stupid, as always, of me to miss it.

What’s the best way to implement this, do you think?
How can I check when it happens? Do I have to wait on every blit, and see
if it returns -2?>From: “Kylotan”

Reply-To: sdl at lokigames.com
To:
Subject: Re: [SDL] fullscreen alt tabbing
Date: Wed, 27 Jun 2001 04:44:17 +0100

From: Robert Clayton <@Robert_Clayton>
Subject: [SDL] fullscreen alt tabbing

Under Windows, when you lose focus on a full screen SDL application
that
uses hardware surfaces, the surfaces can become lost.
How do I check if they have been lost?

In the docs for ‘SDL_BlitSurface’:

“If either of the surfaces were in video memory, and the blit
returns -2, the video memory was lost, so it should be reloaded with
artwork and re-blitted.”

It also gives a short example.

There may be other ways of detecting lost surfaces, but that is the one
that I noticed.


Ben Sizer


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Robert Clayton wrote:

Sorry to bother people again, but I didn’t get any replies to this last
time, and I can’t find it on the web site.

Under Windows, when you lose focus on a full screen SDL application that
uses hardware surfaces, the surfaces can become lost.
How do I check if they have been lost?

Do I set up a thread and check for an event, and if that event arrives
reload my images?

$ man SDL_BlitSurface

But since your using windows I guess I’ll just have to tell you. Check
the return value of SDL_BlitSurface … if its -2, then reload your
surfaces.

-- David Snopek

/-- libksd –
| The C++ Cross-Platform Game Framework
| Only want to write it once??
| http://libksd.sourceforge.net
------------