delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/15/11:44:56

From: "Al Morgan" <muaddib AT proaxis DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Problems with allegro
Date: Sun, 15 Aug 1999 05:34:38 -0700
Organization: Posted via Supernews, http://www.supernews.com
Lines: 52
Message-ID: <rrdcsel3krl32@corp.supernews.com>
X-Complaints-To: newsabuse AT supernews DOT com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019