At 05:03 PM 5/21/02 +0200, you wrote:
glxgears uses OpenGL. The program you wrote uses software
rendering through SDL. Big difference. If you’re running under
X11. You don’t have a hardware surface, unless you’re using the
DGA driver.
I read about so many problems with the framerate using SDL. How is it
possible to get a good framerate like 30-50 fps. How did loki manage
to get a good framerate?
Maybe you have some problems with your GL installation and SDL use
only the software version, so it’s obviously slower than GL/GLUT.
I’m not using GL.
I just tested my framerate with glxgears.
Well, then you’ve been testing two almost separate subsystems. 
I used the code on :
http://www.nostarch.com/plg.htm
And the first example pw-ch4. say i have 13 fps.
Other sdl apps, like effekttv (http://effectv.sourceforge.net/), say,
that i have got ~30fps.
Depends on the resolution, depth, emulation and so on.
Make sure that you use a video mode that’s actually available. (Note that
XFree86 cannot change pixel format without restarting!) Pass 0 for the
bpp argument, to be on the safe side. (If the user is on a 256 color
display, it’s his/her problem, and the only thing you could do about it
would be to try fbdev or svgalib.)
Also make sure all surfaces are converted into the format of the screen
before you start blitting. SDL can convert on-the-fly, but it can be
pretty expensive. See SDL_DisplayFormat() and SDL_DisplayFormatAlpha().
If you can’t get an “acceptable” frame rate at the resolution you need,
you could try glSDL, as suggested. It’s still a wrapper, and not entirely
finished, but seems to do the job for some people already. Frame rates of
300+ fps have been reported with real code on decent 3D cards.
http://olofson.net/mixed.html
And why is SDL always using the whole cpu?
Because you’re doing software rendering without retrace synchronized
pageflipping. That is, as soon as one frame is ready, your application
will start rendering the next one.
Retrace sync is not available on Linux, expept with a few drivers. Also
note that h/w pageflipping and/or retrace sync is often broken or missing
in windowed modes, regardless of platform.
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Tuesday 21 May 2002 19:39, Mirko Koenig wrote:
On Tue, 21 May 2002 17:32:12 +0200, Gabriele Greco wrote: