Re: [AD] Changes to aWiki

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


On Sunday 12 February 2006 15:36, Karthik Kumar wrote:
> http://awiki.tomasu.org/bin/view/Main/Al_create_display_bitmap

Hos is this function different from 4.3's al_create_display (or in other 
words, why does it have an extra _bitmap attached to it)?
The current 4.3 display API (which already works, by the way) looks like 
this:

AL_DISPLAY *al_create_display(int driver, int flags, int depth, int w, int 
h);
int al_set_update_method(AL_DISPLAY *display, int method);
void al_destroy_display(AL_DISPLAY *display);

void al_flip_display(AL_DISPLAY *display);
BITMAP *al_get_buffer(const AL_DISPLAY *display);
int al_get_update_method(const AL_DISPLAY *display);

al_create_display() creates a display (ie, window, or fullscreen blitting 
surface) that gets updated according to some update method (passed in the 
flags field). al_set_update_method() allows one to change the update 
method later on the fly and al_destroy_display() closes the window (or 
shuts down the full-screen mode).

al_flip_display() flips the front and back buffers (or flips to the next 
page in a flipping chain), or does nothing when using a mode where one 
directly blits to the display surface. al_get_buffer() returns a BITMAP 
pointer to the back buffer or current drawing area in the flipping chain, 
and al_get_update_method() returns the update method used for the DISPLAY.

A typical use looks like this:

AL_DISPLAY *dpy = al_create_display(GFX_AUTODETECT, 
AL_UPDATE_TRIPLE_BUFFER, ...);

...
BITMAP *screen = al_get_buffer(dpy);
draw_everything(screen);
al_flip_display(dpy);
...
al_destroy_display(dpy);

Evert




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