Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: "Atte Koivula" , djgpp AT delorie DOT com Date: Fri, 25 Apr 1997 16:18:17 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Problem loading PCX-file using Allegro Precedence: bulk "Atte Koivula" wrote: > Why does this cause a page fault (I'm simply trying to load and blit a > pcx-file called dice.pcx...): > > #include > > 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