From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro (bitmap) Date: Wed, 25 Jun 1997 19:31:29 +0100 Organization: None Distribution: world Message-ID: References: NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 17 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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.