Re: [AD] Changes to aWiki

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


Well...

That day, we were discussing on what's an AL_DISPLAY object and what's the AL_BITMAP object. The name is a little confusing. AL_DISPLAY is an object, which points to a display (like IDirectDraw7 *, or some other object which handles the creation of screen surfaces for us) ... AL_BITMAP *screen points to a screen surface that an user can draw to. (which may be drawn to the real screen sooner/later).

We were thinking of doing something like:

AL_DISPLAY *createdisplay():
void createsurfaces(AL_DISPLAY *display, AL_FORMAT *format,int surfacecount, AL_UPDATEMETHOD method);
AL_BITMAP *getCurrentDrawSurface(AL_DISPLAY *display);
void flip(AL_DISPLAY *display); //this change will be updated in the next call to getCurrentDrawSurface


On 2/15/06, Peter Hull <peterhull90@xxxxxxxxx> wrote:
Now I'm confused. Does it return AL_DISPLAY or AL_BITMAP? If the
former, why is it called al_create_display_bitmap?

My own view is that the destination for all drawing should be implicit
(so, for example, putpixel would be al_putpixel(x, y, colour) ) with a
function to select a particular bitmap as the destination. This is
because most drawing is done to the same bitmap (especially now that
the details of double buffering etc are handled by Allegro) and it
would also get rid of the strange parameter ordering between blit and
draw_sprite.

Pete

On 14/02/06, Evert Glebbeek <eglebbk@xxxxxx> wrote:
> 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



--
Karthik

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