www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/22/09:00:20

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: ?Win95 crash from Allegro:Set_pallete?
Date: Sun, 22 Mar 1998 11:14:53 +0000
Organization: None
Message-ID: <aKzlWDAtKPF1Ew2k@talula.demon.co.uk>
References: <gp4yERS00YUt074kU0 AT andrew DOT cmu DOT edu>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 19
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

James W Sager Iii writes:
>void main(void)
>{
>//640 x 480 mode
> set_gfx_mode(0,640,480,1024,1024);
> allegro_init();

I'm not sure why this would crash, but it is grossly incorrect to call
any other Allegro functions before using allegro_init(). Trying to set a
video mode before initialising the lib is just asking for trouble...

Also, why are you passing zero as the first param to set_gfx_mode()?
Using the GFX_* defines would make your code more readable, and prevent
it from breaking if I ever change what the actual numbers are.


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


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