I had just written a long post when my computer rebooted on its own (actually I think the "windows update: restart now" window came up and I hit enter thinking I was hitting enter in this window... who knows).
So the brief version:
void * imageBuffer = malloc(size); is how you would allocate a dynamic buffer.
(you may need to say
far void * but I don't think so.)
unsigned short imageSize(int left, int top, int right, in bottom) returns the size of a buffer needed to hold an image from coordinates (left, top)-(right, bottom)
void getimage(int left, int top, int right, int bottom, void * imageBuffer) will get an image and place it into the buffer
void putimage (int left, int top, const void * imageBuffer, int op) will put an image to the screen using an given operation:
COPY_PUT - overwites background
XOR_PUT - Xor forground and backgound images
OR_PUT - etc
AND_PUT - etc
NOT_PUT - overwites the background with the negative of the image buffer.
I would not that although BGI works... it is a LAME graphics library and you would be better off to use a 3rd party VESA library. (I used to use one called VSA -- came with a book "unleashed graphics" I think).
Here might be a good place to find some other libraries