Questions about SDL speed

I have started coding in 2 libs, either SDL or TinyPTC
(http://www.gaffer.org:8080/tinyptc/), making tests
about their speed.

A test on my PC with a plasma effect at 64048032bpp
and an FPS counter, showed TPTC to be more than twice
faster than SDL (SDL=145FPS, TPTC=355). I removed the
calculation and left only the output just to be sure I
am not making something wrong. Same results…

It’s not the same in every PC. But in most PCs, TPTC
is faster (because of MMX blitting routines they say).
There were some disagreements about that from some
coder friends, but anyways I discovered this thing
acidentally:

If you run an SDL app in a window, then if you move
the mouse pointer upon a button on the programms bar,
suddenly SDL outputs much faster (almost reaching
TPTC) while the bright yellow box with the programm
description appears. Hard to explain, but this means
that SDL can output to the vram much faster but
something (system? OS? A bug?) blocks it from
achieving the best possible…

I have tried with HW_SURFACE or SW_SURFACE, Double
Buffer (SDL_FLIP) in HW_SURFACE, Windowed or
Fullscreen, everytime the same results.

I could compile TPTC under SDL (there is a port) to
have both gfx speed and the rest from SDL that TPTC
misses (keyboard, sound, etc.) but for the moment I
had problems with that…

Or I could find out what’s wrong and how can I make
SDL output the best possible. Because I have seen it
is, but something is going wrong with either my code,
the system or anything…

And I am getting very curious about the matter…

Optimus

p.s. I am sorry about too much text. I hope you can
give me some clue, someone must have an idea around
here. Ask me any questions, I will try to become more
clear and brief…__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Now this IS interesting… I want an explanation for the speed
increase when hovering over the programs bar too.

-TomT64

Michael Kargas wrote:>I have started coding in 2 libs, either SDL or TinyPTC

(http://www.gaffer.org:8080/tinyptc/), making tests
about their speed.

A test on my PC with a plasma effect at 64048032bpp
and an FPS counter, showed TPTC to be more than twice
faster than SDL (SDL=145FPS, TPTC=355). I removed the
calculation and left only the output just to be sure I
am not making something wrong. Same results…

It’s not the same in every PC. But in most PCs, TPTC
is faster (because of MMX blitting routines they say).
There were some disagreements about that from some
coder friends, but anyways I discovered this thing
acidentally:

If you run an SDL app in a window, then if you move
the mouse pointer upon a button on the programms bar,
suddenly SDL outputs much faster (almost reaching
TPTC) while the bright yellow box with the programm
description appears. Hard to explain, but this means
that SDL can output to the vram much faster but
something (system? OS? A bug?) blocks it from
achieving the best possible…

I have tried with HW_SURFACE or SW_SURFACE, Double
Buffer (SDL_FLIP) in HW_SURFACE, Windowed or
Fullscreen, everytime the same results.

I could compile TPTC under SDL (there is a port) to
have both gfx speed and the rest from SDL that TPTC
misses (keyboard, sound, etc.) but for the moment I
had problems with that…

Or I could find out what’s wrong and how can I make
SDL output the best possible. Because I have seen it
is, but something is going wrong with either my code,
the system or anything…

And I am getting very curious about the matter…

Optimus

p.s. I am sorry about too much text. I hope you can
give me some clue, someone must have an idea around
here. Ask me any questions, I will try to become more
clear and brief…


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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

Just a stab in the dark but maybe it has something to do with drawing the
mouse cursor to the screen?

You might try disabling the mouse cursor to see if you get the faster speeds
that way too.

int SDL_ShowCursor(int toggle);

is the function to toggle the cursor> ----- Original Message -----

From: mkargas_dm@yahoo.com (Michael Kargas)
To:
Sent: Thursday, November 18, 2004 9:45 AM
Subject: [SDL] Questions about SDL speed.

I have started coding in 2 libs, either SDL or TinyPTC
(http://www.gaffer.org:8080/tinyptc/), making tests
about their speed.

A test on my PC with a plasma effect at 64048032bpp
and an FPS counter, showed TPTC to be more than twice
faster than SDL (SDL=145FPS, TPTC=355). I removed the
calculation and left only the output just to be sure I
am not making something wrong. Same results…

It’s not the same in every PC. But in most PCs, TPTC
is faster (because of MMX blitting routines they say).
There were some disagreements about that from some
coder friends, but anyways I discovered this thing
acidentally:

If you run an SDL app in a window, then if you move
the mouse pointer upon a button on the programms bar,
suddenly SDL outputs much faster (almost reaching
TPTC) while the bright yellow box with the programm
description appears. Hard to explain, but this means
that SDL can output to the vram much faster but
something (system? OS? A bug?) blocks it from
achieving the best possible…

I have tried with HW_SURFACE or SW_SURFACE, Double
Buffer (SDL_FLIP) in HW_SURFACE, Windowed or
Fullscreen, everytime the same results.

I could compile TPTC under SDL (there is a port) to
have both gfx speed and the rest from SDL that TPTC
misses (keyboard, sound, etc.) but for the moment I
had problems with that…

Or I could find out what’s wrong and how can I make
SDL output the best possible. Because I have seen it
is, but something is going wrong with either my code,
the system or anything…

And I am getting very curious about the matter…

Optimus

p.s. I am sorry about too much text. I hope you can
give me some clue, someone must have an idea around
here. Ask me any questions, I will try to become more
clear and brief…


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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

Just a stab in the dark but maybe it has something
to do with drawing the mouse cursor to the screen?

You might try disabling the mouse cursor to see if
you get the faster speeds that way too.

I have just tried it and it still gives the same
results…

p.s. Sorry for replying late. I bought a Radeon9600pro
and now the results are more normal. The speed is
almost not affected and it’s much better than before,
I wish I could have the opportunity and time to
experiment with my old gfx card and find out the
answer though…

p.p.s. A friend guesses:

"This looks like it should have to do something with
Windows event processing for the SDL main window. What
events are generated when this thing appears? Perhaps
redraw events with zero area specified? I believe, SDL
ignores the dirty area specification when it needs to
redraw, and redraws the whole window - by calling your
drawing function, which does the drawing and the
counter increment. I haven’t looked at, but TinyPTC
probably just doesn’t process these events, because it

expects the user code to simply redraw as often as
possible.

It would mean that SDL is trying to be more
Windows-conformant and just goes to sleep to give
other applications time. This should happen less as
your application makes more CPU workload."__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail