What exactly does this do?
Does it blit part of the parent to a newly created child?
Or does it set up like a pointer within the BITMAP* and a clip x y and a width and height?
It's just for efficiency reasons you see.
AFAIR it is closer to the second method - just faslty setup some pointers/integers (clipping) to access something insied other bitmap's data
second point. but you still need to destroy it when finished, and of course destroy it before you destroy the master.
Yeah I use it in situations like when I have a sprite sheet.
BITMAP *sprite_sheet=load_pcx("blah/blah.pcx",NULL); BITMAP *frame=create_sub_bitmap(sprite_sheet,0,0,0,0); draw_sprite(buffer,frame,x,y); destroy_bitmap(frame);
Or
draw_sprite(buffer,create_sub_bitmap(sprite_sheet,0,0,0,0),x,y);
draw_sprite(buffer,create_sub_bitmap(sprite_sheet,0,0,0,0),x,y);
Except thats a horrible memory leak.
Figures. My code usually winds up being terrible.
So stick to method 1? =]