Our change to dx5_video.c

Hey, Sam.

Regarding the change that lets hardware surfaces work in windowed mode
under Windows…

Sorry it took so long to get back to you; the guy who did the work was out.

on line 1370 we changed:

                 video->flags |= SDL_SWSURFACE;

to:

     if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE )
                 video->flags |= SDL_HWSURFACE;
     else
                 video->flags |= SDL_SWSURFACE;

And that’s it. We saw a 3-10x performance increase on most machines in
windowed mode. ANd even more if you’re bltting from hw surface to hw
surface. Of course, now we’re having trouble with lost surfaces – SDL
doesn’t always report when a surface is being lost.

     Kent

Kent Quirk, CTO, CogniToy
@Kent_Quirk
http://www.cognitoy.com

And that’s it. We saw a 3-10x performance increase on most machines in
windowed mode. ANd even more if you’re bltting from hw surface to hw
surface. Of course, now we’re having trouble with lost surfaces – SDL
doesn’t always report when a surface is being lost.

Again,
What flags are you passing to SDL_SetVideoMode()?
Are you locking the SDL screen surface directly, or only doing surface blits?

As for surfaces being lost, if you track that down, please let me know!
The code should restore the surfaces, but apparently it’s not always
possible, and the error code isn’t propogated back up.

It’s one of the things that really annoys me about the current API, is
that there’s no explicit “lost surface” handling, and that’s definitely
changing in the next API revision. But, until then I want to make sure
it’s not completely broken.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

maybe I’m being overly picky, but
isn’t:
if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE )

the same as:

if(flags& SDL_HWSURFACE)

since any nonzero value is true? Although it’s only a cycle or two, wouldn’t
this be minisculely better (or would optimising compilers handle this?

-Jim

I received ~40 copies of this email? Did anyone else?
Is my mail screwed up again?> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org] On Behalf Of
Sam Lantinga
Sent: Wednesday, May 29, 2002 4:57 PM
To: sdl at libsdl.org
Subject: Re: [SDL] our change to dx5_video.c

And that’s it. We saw a 3-10x performance increase on most machines in

windowed mode. ANd even more if you’re bltting from hw surface to hw
surface. Of course, now we’re having trouble with lost surfaces – SDL

doesn’t always report when a surface is being lost.

Again,
What flags are you passing to SDL_SetVideoMode()?
Are you locking the SDL screen surface directly, or only doing surface
blits?

As for surfaces being lost, if you track that down, please let me know!
The code should restore the surfaces, but apparently it’s not always
possible, and the error code isn’t propogated back up.

It’s one of the things that really annoys me about the current API, is
that there’s no explicit “lost surface” handling, and that’s definitely
changing in the next API revision. But, until then I want to make sure
it’s not completely broken.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I received ~40 copies of this email? Did anyone else?
Is my mail screwed up again?

I only got the one copy.

–ryan.

Hey, Sam.

Regarding the change that lets hardware surfaces work in windowed mode
under Windows…

Sorry it took so long to get back to you; the guy who did the work was out.

on line 1370 we changed:

                 video->flags |= SDL_SWSURFACE;

to:

     if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE )
                 video->flags |= SDL_HWSURFACE;
     else
                 video->flags |= SDL_SWSURFACE;

And that’s it. We saw a 3-10x performance increase on most machines in
windowed mode. ANd even more if you’re bltting from hw surface to hw
surface. Of course, now we’re having trouble with lost surfaces – SDL
doesn’t always report when a surface is being lost.

I added this code, made a minor change in the surface allocation code,
and it seems to work for me. When the surface is lost, I get the correct
"surface lost" error from SDL. Under what conditions are you not getting
that error? Can you try the latest CVS code (with #if 0 -> #if 1) and
let me know if that fixes the problem?

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment