delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/25/15:32:39

Message-Id: <m0wKkd2-000S1uC@natacha.inti.edu.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT edu DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
Organization: INTI
To: "Atte Koivula" <keijo DOT koivula AT pp DOT inet DOT fi>, djgpp AT delorie DOT com
Date: Fri, 25 Apr 1997 16:18:17 +0000
MIME-Version: 1.0
Subject: Re: Problem loading PCX-file using Allegro

"Atte Koivula" <keijo DOT koivula AT pp DOT inet DOT fi> wrote:

> Why does this cause a page fault (I'm simply trying to load and blit a
> pcx-file called dice.pcx...):
> 
> #include <allegro.h>
> 
> void main()
> {
>  allegro_init();
>  BITMAP *dice;
>  PALETTE dicepalette;
>  dice=load_bitmap("c:/djgpp/atte/progs/dice.pcx", dicepalette);
>  set_gfx_mode(GFX_MODEX,320,200,0,0);
>  set_palette(dicepalette);
>  blit(dice,screen,0,0,0,0,dice->w,dice->h);
>  destroy_bitmap(dice);
> }
> 
EVER check if the load_bitmap was OK:

if ((dice= load_bitmap("c:/djgpp/atte/progs/dice.pcx", dicepalette))==NULL)
  {
   printf("Error loading the PCX\n");
   allegro_exit();
   exit(1);
   }

Perhaps dice.pcx is a wrong PCX file, or have an unsupported color depth or you 
misstyped the name.

SET
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


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