Re: [AD] BUG(?): Page flipping and vsync |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> From the docs::show_video_bitmap(..):
>
> "Allegro will handle any necessary vertical retrace synchronisation when
> page flipping, so you don't need to call vsync() before it. This means
> that show_video_bitmap() has the same time delay effects as vsync()."
>
> This is true for GFX_DIRECTX_FULLSCREEN, but not for GFX_DIRECTX_WINDOWED,
> though vsync is supported when windowed.
Well, this is also true for the GFX_DIRECTX_WINDOWED driver but not as
clearly as for the GFX_DIRECTX_FULLSCREEN driver.
In fullscreen mode, page-flipping really means flipping two pages of video
memory, i.e moving the point in video memory from which the video card
starts to send data to the monitor. In order to make sure that the flip
doesn't happen in the middle of the screen retrace, we have to wait for the
hotspot to be at the bottom of the screen.
In windowed mode, we don't use two pages of video memory because we need to
preserve the Windows desktop around the window. So we _emulate_
page-flipping by using a backbuffer which is block-copied onto the screen
when the flip() method is invoked. To sum up, page-flipping is actually
double-buffering in windowed mode and we don't need to bother with the
vertical retrace when double-buffering because the video card does it for
us.
--
Eric Botcazou