Mail Archives: djgpp/1999/08/15/11:44:56
I've gotten some basic stuff to work using allegro, Mode-X graphics (i still
haven't gotten that to work without using a 3rd party library, grrr...) ,
keyboard, mouse, and I've been able to load bitmaps and draw them on the
screen. The problem is when I tried to set the palette, beacuse my picture
was turning out all wrong colors, but when I did, it gave an error (copied
below my program). Is it me, or is it my computer that has a problem?
#include <allegro.h>
#include <conio.h>
void main()
{
allegro_init();
install_keyboard();
install_mouse();
set_gfx_mode(GFX_MODEX, 320, 240, 320, 480);
PALETTE *p;
BITMAP *belive = load_bmp("c:\\belive.bmp", *p); // mulder's "I want to
belive" poster
set_palette(*p); // HERE'S WHERE THE PROBLEM IS
draw_sprite(screen, belive, 0, 0);
getch();
destroy_bitmap(belive);
allegro_exit(); // i know i don't need it, but i'm paranoid
}
Shutting down Allegro
Exiting due to signal SIGSEGV
Page fault at eip=000098b1, error=0006
eax=00000000 ebx=001db000 ecx=00000005 edx=00000000 esi=001dafec
edi=00000018
ebp=00000000 esp=001daf64 program=C:\DJGPP\PROJ\TEST.EXE
cs: sel=00a7 base=83ce8000 limit=ffb9afff
ds: sel=00af base=83ce8000 limit=ffb9afff
es: sel=00af base=83ce8000 limit=ffb9afff
fs: sel=00bf base=00000000 limit=0010ffff
gs: sel=00bf base=00000000 limit=0010ffff
ss: sel=00af base=83ce8000 limit=ffb9afff
App stack: [001db000..0015b000] Exceptn stack: [0004c248..0004a308]
Call frame traceback EIPs:
0x000098b1
- Raw text -