Re: [AD] Thoughts on speeding up X |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Saturday 31 July 2004 02:41, Chris wrote:
> Actually, I think I have something like this pretty much done already..
Oh, so do I, in fact ;)
Most of my programs call an initialize_graphics() function to set the
parameters of the display mode, then at update time they call
prepare_gfx_update() which does whatever the current update method
requires to prepare (eg, clear the DRS stack, make sure the proper page is
displayed), they don't acces screen directly but use a get_screen_bmp()
function that either points them to the relevant display page or to a
double buffer. At the end of the drawing cycle, they call
gfx_update_done() which does the page flipping or DRS update.
If I need acces to the bitmap that is currently being displayed on the
monitor (for an FPS counter that is always updated, or for use ofthe
Allegro GUI), I call get_monitor_bmp().
So that's
initialize_graphics()
begin_gfx_update()
gfx_update_done()
get_screen_bmp()
get_monitor_bmp()
There is one additional function, mark_rect(), for use with dirty
rectangles that's not particularly relevant to the current discussion IMO.
> We already have the functions to indicate the beginning
> and end of a drawing cycle: acquire_bitmap and release_bitmap. I'll look
> around to see if I still have the code.
I'm not sure I like extending their use to this range, personally.
Evert