Performance question

Hi,
I am trying to playback a sequence of X screen dumps using SDL. The
screen dumps are actually a recording of an X session. I have another
program that does the same thing but uses X calls directly instead of using
an abstraction like SDL. I found that SDL performs rather slow compared to
using the raw API. I use the clock captured in the screen dumps as a basis
for evaluation.
I am using SDL_HWSURFACE in SDL_SetVideoMode. The depth is 24 bpp. Am i
doing something wrong or is the slowness to be expected ? I realize that SDL
relies on X after all.

Thanks in advance,
-Krishna

Hi,
I am trying to playback a sequence of X screen dumps using SDL. The
screen dumps are actually a recording of an X session. I have another
program that does the same thing but uses X calls directly instead of using
an abstraction like SDL. I found that SDL performs rather slow compared to
using the raw API. I use the clock captured in the screen dumps as a basis
for evaluation.
I am using SDL_HWSURFACE in SDL_SetVideoMode. The depth is 24 bpp. Am i
doing something wrong or is the slowness to be expected ? I realize that SDL
relies on X after all.

It sounds like you’re getting some conversion going on in the background.
Make sure that you pass 0 for the depth in SDL_SetVideoMode() instead of
24, since the screen is really at 32 bpp, and if you ask SDL for 24 bpp,
you’ll actually get conversion to and from the slowest pixel format out
there. :slight_smile:

Remind me to use 32 bpp behind the scenes when asked for 24 bpp in SDL 2.0 :slight_smile:

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

Sam Lantinga wrote:

Remind me to use 32 bpp behind the scenes when asked for 24 bpp in SDL 2.0 :slight_smile:

There are older cards out there that really do use 24-bit pixels, in
order to save memory. I don’t know if there are any newer cards that
still do this. Last time I paid attention to this kind of detail was in
the days when 1 MB of video memory was a lot, and people did all kinds
of trickery to conserve it.

I suppose you could have an SDL mode for “no really, I’m not kidding,
give me 24bpp surfaces”.

Sam Lantinga wrote:

Remind me to use 32 bpp behind the scenes when asked for 24 bpp in SDL 2.0 :slight_smile:

There are older cards out there that really do use 24-bit pixels, in
order to save memory. I don’t know if there are any newer cards that
still do this. Last time I paid attention to this kind of detail was in
the days when 1 MB of video memory was a lot, and people did all kinds
of trickery to conserve it.

I suppose you could have an SDL mode for “no really, I’m not kidding,
give me 24bpp surfaces”.

Yeah, I was mostly kidding. :slight_smile:

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