[AD] offscreen sub bitmaps revisited

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


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));

--
Matthew Leverton




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