Re: [AD] set_palette and vsync in X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> This version of vsync doesn't call XSync (and thus the XLOCK associated 
> with it), since AFAICS XSync has nothing to do with the screen retrace. 

Looks like you're right - although it's possible that the X server keeps 
events queued and waits for a retrace, making XSync implicitly wait for 
one.

> It uses the retrace_count variable to time the retrace.

How reliable is the retrace simulator?

Also, looking at the docs:

extern volatile int retrace_count;
     If the retrace simulator is installed, this count is incremented
     on each vertical retrace; otherwise, if the refresh rate is known,
     the count is incremented at the same rate (ignoring retraces);
     otherwise, it is incremented 70 times a second. This provides a
     useful way of controlling the speed of your program without the
     hassle of installing user timer functions.

     The speed of retraces varies depending on the graphics mode. In
     mode 13h and 200/400 line mode-X resolutions there are 70 retraces
     a second, and in 240/480 line modes there are 60. It can be as low
     as 50 (in 376x282 mode) or as high as 92 (in 400x300 mode).

Anyone agree that the sentence ``this provides a usefule way of controlling 
the speed of your program'' should be removed, as it;s usually the first 
thing you tell newbies NOT to do (rely on the retrace to control 
gamespeed)?
Also, the second paragraph contains a lot of very old DOS-specific 
information, which I guess can be purged by now.

Evert





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/