RE: [AD] BUG(?): Page flipping and vsync |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> 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.
The same is true when windowed.
> 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.
I doubt this.
When doing page-flipping in windowed mode I get over 300 FPS (320*240*32).
I tested displaying two coloured buffers, one (255, 0, 255) and the other
(0, 255, 0). When windowed it heavily flickers: green and purple bars
moving all over the place. It's the same effect you'd get with regular
page-flipping: A part of the videocard's buffer gets sent to the monitor,
we update the videocard's buffer, another part is sent, ...
I have to call vsync manually to stop it from flickering and get a 'nice'
grayish colour. I don't have to do this with the fullscreen driver, so the
(added) call to vsync will do a double vsync and I get only 30 FPS.
IMHO the windowed driver should implement vsync too.