Mail Archives: djgpp/1998/01/02/04:15:50
I'm experimenting with reading 256 color bitmaps from disk and
displaying them on the screen using Allegro. The problem is that the
colors come out wrong, which I assume could only be because the palette
is wrong. If this is true, then allegro must not automatically set the
palette to whatever is appropriate for that image, which kind of
surprises me...But anyway... I would greatly appreciate it if someone
could fill me in on how to set the correct palette for a given bitmap
(e.g. how to create a variable of type PALETTE from the bitmap).
Just to make sure my problem isn't something completely different, I'm
including the source code below. I get the same
result when I use a datafile.
#include <allegro.h>
BITMAP *thing;
PALETTE pte;
main () {
set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0);
thing = load_bmp("rose.bmp", pte);
blit(thing, screen, 1, 1, 1, 1, 100, 100);
}
- Raw text -