[SDL] How to disable screen blanking/saver?

W. Michael Petullo mike at flyn.org
Sat Jul 20 13:51:01 PDT 2002


(I hope this is an appropriate list topic)

If I add a 2 second delay in glmovie before SMPEG_play() I see all the
frames of my mpg file from the beginning, with no delay I miss about the
first 120.  This seems to be the time X takes to change the screen res
from 1024x768 to 640x480.  If I modify glmovie.c to use 1024x768 no
delay is needed.  One small mystery solved.

Another mystery remains with the callback to do the screen display. 
Using the callback (rather than putting glmpeg_update() in the main
loop) glmpeg_update() is actually called every time a new frame is read,
just as it should be.  However, instead of glmovie_draw() (the place
where the OpenGL stuff is done) taking about 5 or 10 ms, as it does when
the callback is not used, it only takes 0 or 1 ms (to tick resolution). 
What is more, it does draw the _last_ frame, but it seems to draw it
more or less immediately.  In other words, instead of seeing the movie
you see just the last frame, held static for the duration of the movie. 

I can't understand how the program knows what the last frame is before
it has read through the whole mpg file.  Maybe it looks at it first for
some reason (Sam?).  The other puzzle is why the other frames (from the
beginning of the file) don't get displayed.  Since glmovie_draw is
getting called, my guess is that the block of pixels passed to it is not
changing for some reason.

All the testing I've done is with audio disabled, since I haven't set up
the audio system under Linux yet.

Gib
--------------------------------------------
Gib Bogle              bogle at ihug.co.nz
1/44 Arthur St         Tel: (64-9) 525-6878
Ellerslie, N.Z.        Fax: (64-9) 525-6878
--------------------------------------------




More information about the SDL mailing list