Mail Archives: djgpp/1997/04/25/15:32:39
"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 -