Re: [AD] al_set_target_bitmap question |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] al_set_target_bitmap question
- From: Elias Pschernig <elias@xxxxxxxxxx>
- Date: Sat, 05 Jan 2008 14:12:41 +0100
On Sat, 2008-01-05 at 10:25 +0000, Peter Hull wrote:
> In al_set_target_bitmap, is there a restriction on what kind of bitmap
> can be passed? The reason for asking is that the current display is
> all set up with a vtable appropriate for a particular kind of driver
> (say OpenGL, or whatever) then if you pass an arbitrary bitmap that
> vtable might not be appropriate.
>
> On in other words I'm not sure how al_set_target_bitmap is supposed to
> work. Could someone help?
>
No, we allow drawing to any kind of bitmap. So if you have some bitmap,
and want to draw a line to it, you do:
al_set_target_bitmap(bmp);
al_line(x, y, tx, ty, color);
To draw to the backbuffer again, you do:
al_set_target_bitmap(al_get_display_backbuffer());
Actually, I don't like that last bit at all, but not sure what would be
a better solution. Maybe just a shortcut:
al_unset_target_bitmap()
or
al_set_backbuffer_target()
About the vtable not being appropriate, each ALLEGRO_BITMAP has its own
ALLEGRO_BITMAP_INTERFACE property and also a pointer to the display it
belongs to, should be enough to figure out what to do I think. But I
never tried to mix different kinds of displays so far - maybe if you can
give a more concrete example showing a possible problem.
--
Elias Pschernig <elias@xxxxxxxxxx>