RE: RE: [AD] No more video/system bitmaps

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


On Tue, 2005-06-21 at 10:31 -0700, Robert Ohannessian wrote:
> It's an interesting idea. It would sure make the AGL code a lot simpler.
> 
> 
> Alternatively, we can write the API this way, to reduce the object
> management on apps:
> 
> 	select_bitmap(my_bitmap); // Output to 'my_bitmap'
> 	putpixel(100, 100, ...);
> 	...
> 	select_bitmap(NULL);  // Return to default output
> 	
> 
> We would also need to restrict 'my_bitmap' so that it's not the source
> of any operation while it is selected as the destination.
> 

I like this as well. And yes, just using select_bitmap instead of having
additional context objects sounds better to me. Internally, maybe each
bitmap could have an pointer to an AL_CONTEXT if we need it, but don't
expose it to the user unnecessarily. I think the focus of Allegro should
stay that it should be be easier to use than OpenGL.

And I think, also the color should be made a parameter of the current
context. So you would do:

al_select_bitmap(my_bitmap);
al_set_color(1, 0, 0, 1); // red color is set for the context of my_bitmap
al_line(100, 100, 200, 200); // a line is drawn into my_bitmap
al_select_bitmap(); // default output
al_draw_bitmap(my_bitmap, 50, 50); // my_bitmap is drawn

-- 
Elias Pschernig





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