Re: [AD] offscreen sub bitmaps revisited

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


On Mon, 2010-06-21 at 12:01 -0500, Matthew Leverton wrote:
> There was a discussion a while back regarding this. It diverged into
> several different concepts. To make things less confusing, I'd like to
> keep this discussion limited to this specific request.
> 
> ALLEGRO_BITMAP *bmp = al_create_sub_bitmap(parent, -32, -32, 64, 64);	
> al_set_target_bitmap(bmp);	
> al_draw_filled_rectangle(0, 0, 32, 32, al_map_rgb(255,255,255));
> 
> I would expect that to draw nothing, since the upper-left part of the
> bitmap is "off screen." However, Allegro silently repositions the sub
> bitmap at (0,0) with the dimensions of (32,32). As such, a 32x32 white
> bitmap is seen.
> 
> Is it possible given OpenGL and D3D to support the intuitive behavior?
> e.g., I would expect the above code to do the same thing as:
> 
> al_set_target_bitmap(parent);	
> al_draw_filled_rectangle(-32, -32, 0, 0, al_map_rgb(255,255,255));
> 

Yes, I think we agreed on it already in that thread (and on other things
like moving sub bitmaps and so on :P). For OpenGL it makes no
difference, the actual vertex positions will be the same in both of your
examples.

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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