[AD] [WIN] pageflip needs fixing before 4.0

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


Some gfx drivers have problems with the current windows bodge of allocating
3 video pages that causes pageflip to flicker. This is fixed by only
allocating 2 buffers, which is currently not possible as it is unknown if
the programme will use triple buffering. I am posting this here for thoughts
on the best solution:

1) Do nothing, and update the docs to explain this problem and that
programmes should always offer triple buffer (which always works) too. I was
thinking of writing a framework C file that does all the initing of gfx,
timers etc and users just include it in their project, along with their C
files and this framework will call gameinit() then gameloop() at intervals
set by the user (say 100hz, and would pageflip/tripbuf/double buf
automatically) until gameloop() returns -1 then call gameexit(). This would
solve a lot of problems allegro coders make for themselves, but I only want
to do this if there is a good chance it will be put in the Allegro library
distro.

2) Add a var or set_video_pages (int numpages); function (like
set_color_depth) to be called before set_gfx_mode.

3) Use a scheme like the older allegro virtualpage pageflip:
set_gfx_mode (GFX_AUTODETECT, 640, 480, 0, 0); //use current method, alloc 2
bb
set_gfx_mode (GFX_AUTODETECT, 640, 480, 640, 960); //alloc 1 bb (pageflip)
set_gfx_mode (GFX_AUTODETECT, 640, 480, 640, 1440); //alloc 2 bb (triple
buf)
This should be clearly mentioned and explained in the docs and examples.
Also mention the first calls to create_video_bitmap should be for the vid
pages.

4) Allocate 2 pages (1 backbuffer) so pageflip works on call to
set_gfx_mode, then release DD and re-init DD with 2 backbuffers if it turns
out a 2nd is needed for triple buffer (3rd call to create_video_bitmap with
screen dimensions with no intervening call(s) to create_video_bitmap with <>
screen dimensions). "Nightmare!" - Eric Botcazou

Robin




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