Mail Archives: djgpp/1997/06/26/14:16:53
>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...
So I'd just say something like
char *dat;
dat = (char *) screen->line[0];
or something?
- Raw text -