Mail Archives: djgpp/1997/06/26/08:16:54
Adam writes:
>What's the fastest way to get an 'unsigned char Screen[resx*resy]' into an
>Allegro BITMAP?
The best way is to make them share a region of memory. Either allocate
the buffer as an Allegro BITMAP (by calling create_bitmap()) and then
use bmp->line[0] as the base address of your array, or construct a new
bitmap object around your existing array. That would require a fair
amount of messing with the internals of the BITMAP structure, though,
which is obviously more likely to break with future versions of the
code: look at the source for the create_sub_bitmap() routine (in
graphics.c) to get an idea what you'd have to do...
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
Beauty is a French phonetic corruption of a short cloth neck ornament.
- Raw text -