DX5 Front buffer Lost Surface

Lordy I hate direct draw…

In DX5_WindowUpdate, there isn’t a check for lost surface. So if another
app gets exclusive mode, the screen goes black and stays that way until
resized.

I copied the restore code from another routine and this seems to be working:
(after, of course, getting the result from the blt…)

if(result == DDERR_SURFACELOST )
{
result = IDirectDrawSurface3_Restore(SDL_primary);
result = IDirectDrawSurface3_Blt(SDL_primary, &dst,
this->screen->hwdata->dd_surface, &src,
DDBLT_WAIT, NULL);
}

Yep, this was problem for me also. It is great to find somebody to write a
solution for this. :wink:

Can it be added to windows sdl version, or it is already done? Because
this bug really sux, as there was no nice way to detect it, and there
was need to make an ugly workaround for it.

KovacsOn Wed, 18 Oct 2000, Manny wrote:

Lordy I hate direct draw…

In DX5_WindowUpdate, there isn’t a check for lost surface. So if another
app gets exclusive mode, the screen goes black and stays that way until
resized.

I copied the restore code from another routine and this seems to be working:
(after, of course, getting the result from the blt…)

if(result == DDERR_SURFACELOST )
{
result = IDirectDrawSurface3_Restore(SDL_primary);
result = IDirectDrawSurface3_Blt(SDL_primary, &dst,
this->screen->hwdata->dd_surface, &src,
DDBLT_WAIT, NULL);
}

Lordy I hate direct draw…

In DX5_WindowUpdate, there isn’t a check for lost surface. So if another
app gets exclusive mode, the screen goes black and stays that way until
resized.

Doh! Thank you very much for this fix, it’s now in CVS.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software