www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/18/20:16:00

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: easy Allegro grahics help
Date: Wed, 17 Dec 1997 16:53:28 +0000
Organization: None
Distribution: world
Message-ID: <UVZWxpAIOAm0Ewbk@talula.demon.co.uk>
References: <34974CE7 DOT 421A AT alpha DOT delta DOT edu>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 21
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Matt Kris writes:
>int main()
>{
>  int allegro_init();
>  int color, x, y;

I'm afraid both the people who replied to this have missed the real
problem! They are right in suggesting that explicitly calling the
shutdown functions will make your program return to text mode, but the
real problem, and the reason it doesn't do this automatically, is that
you are failing to initialise Allegro in the first place.

When you write "int allegro_init();", that is a function prototype,
telling the compiler that this function exists rather than actually
calling it. Remove the "int", and move this line to after you declare
the local variables, and all will be well...


--
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