From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot) Newsgroups: comp.os.msdos.djgpp Subject: Re: wierd problem in Allegro 3.0 Date: Sat, 18 Apr 1998 03:50:38 GMT Organization: [posted via] Easynet UK Lines: 48 Message-ID: <353821bd.10390868@news.easynet.co.uk> References: <353362C2 DOT 5556 AT cc DOT umanitoba DOT ca> <01bd6876$1b9633a0$3df706c3 AT mbizon DOT nordnet DOT fr> <353515fd DOT 9237060 AT news DOT easynet DOT co DOT uk> <353608AC DOT 3F56 AT cc DOT umanitoba DOT ca> NNTP-Posting-Host: foot.easynet.co.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Thu, 16 Apr 1998 08:33:32 -0500, Count Razumovsky wrote: >#include > >int main(){ > > allegro_init(); > > install_keyboard(); > > set_gfx_mode(GFX_AUTODETECT,640,480,0,0); /* ******* */ You didn't check the return value. set_gfx_mode cannot always set the mode you want; if it fails, it returns a negative number, and you shouldn't try to draw any graphics to the screen if it does fail. Try this: if (set_gfx_mode(.....) < 0) { fprintf (stderr, "Can't set graphics mode: %s\n", allegro_error); exit (1); } > > textout_centre(screen,font,"HI",160,100,255); > > readkey(); > > return 0; >} >funny thing is that the line with the ******* will run just fine if I >have: > >set_gfx_mode(GFX_AUTODETECT,320,200,0,0); > >but once I try to go to 640 by 480 I get that wierd message. I can't >see what the problem would be. That's because almost all cards support 320x200x256, but not all support 640x480x256. You might have more luck if you install a VESA driver, such as UniVBE. I suggest you play around with either the demo game (in the `demo' directory) or the test program (in the `test' directory), both of which let you try out different graphics modes. -- george DOT foot AT merton DOT oxford DOT ac DOT uk