[SDL] vertical retrace in SDL

Sam Lantinga slouken at devolution.com
Sat Jan 20 19:10:07 PST 2001


> Hi,
>     I have noticed that the SDLgears sample program behaves differently
> under windows to linux. Windows supports my TNT2 card, and gives a frame
> rate of 60fps. Linux does not support it (at least it's not set up), but
> gives me over 100fps! Presumably this is because windows waits for the
> vertical retrace but linux does not. How do I make it wait for the
> retrace? Otherwise I'm only wasting processor time on frames which are
> never displayed.

It's possible.  Anybody know the details of the Win32 OpenGL drivers?

>     Incidently could this be why my keyboard reponses are slow under
> Linux but no windows?

No, the reason for that is that SDL is pushing the X server as hard as
it can for 3D graphics, and I haven't found a decent time to perform a
"wait for the X server to catch up" sync.  Most of the time this isn't
a problem, as the X server isn't very busy while 3D hardware is doing
the GL processing, and can handle events just fine.

>     Also I notice the documentation says that SDL_Flip() waits for
> retrace, but doesn't say that the OpenGL equivilent (forget what it's
> called) will wait.

The GL equivalent does not wait for retrace.  Waiting for retrace isn't
supported on any of the Linux drivers, that I know of.

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



More information about the SDL mailing list