[AD] offscreen sub bitmaps revisited |
[ 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: [AD] offscreen sub bitmaps revisited
- From: Matthew Leverton <meffer@xxxxxxxxxx>
- Date: Mon, 21 Jun 2010 12:01:04 -0500
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