From: Elias P. <eli...@gm...> - 2011-01-11 15:57:43
|
On Tue, Jan 11, 2011 at 4:51 PM, Hendrik Boom <he...@to...>wrote: > On Tue, Jan 11, 2011 at 04:36:20PM +0100, Elias Pschernig wrote: > > > > When vsync is enabled, al_flip_display() will only return at the next > sync. > > So if your refresh rate is 60Hz, al_flip_display() will wait for the next > 60 > > Hz tick before it returns. (In realitc, the OpenGL driver does this, > > al_flip_display() simply calls glxFlip() or something like that.) > > So if your frame rate happens to be higher than the refresh rate, > you'll be slowed to just one frame per refresh (as al_flip_display() > waits for the next tick before returning?) > > No, but you will skip drawing some of them. If your game updates 100 times a second, but your monitor only displays 60 picture per second, the only way to avoid it would be to blend some frames together. In a "typical" Allegro 5 game loop, it means you'd sometimes handle multiple ALLEGRO_EVENT_TIMER events before you get to the place where you call al_flip_display again. |