Mail Archives: djgpp/1998/10/13/17:41:44
On Mon, 12 Oct 1998, Aaron wrote:
> How can I set the palette in Allegro to use the palette from a 256 color
> Windows bitmap file?
BITMAP *bitmap;
PALETTE the_palette;
...
bitmap = load_bitmap ("file.bmp", the_palette);
set_palette (the_palette);
Look up `set_palette' and `load_bitmap' in the documentation for
more information. Note that you really ought to check that
`load_bitmap' does not return NULL -- I left this out for
brevity. In addition, special things need to be considered if
you're loading a bitmap of a different colour depth to the
screen.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html
- Raw text -