www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/07/08:25:53

From: Shawn Hargreaves <shawn AT talula DOT demon DOT co DOT uk>
To: djgpp AT delorie DOT com
MMDF-Warning: Parse error in original version of preceding line at punt-1.mail.demon.net
Subject: Re: allegro: textout_centre() / gfx_mode_select()
Date: Wed, 7 May 1997 09:04:54 +0100
MIME-Version: 1.0
Message-ID: <863006333.0522349.0@[194.129.18.166]>

KaRNaGE writes:
> if (!gfx_mode_select(&video_card, &VIDEO_MAX_X, &VIDEO_MAX_Y))
[snip]
>  sprintf(sbuffer, "blah %3d", x_angle);
>  textout_centre(vir_seg, font, sbuffer, SCREEN_W >> 1, SCREEN_H - 40,
255);

This is the culprit: gfx_mode_select() is changing the text drawing mode,
and the details of what you do with it will affect which mode you are left
in. Before calling textout(), you need to reset the mode by calling
text_mode(0), text_mode(-1), or whatever...

>   /* that's pretty mutch all you need to know i think...*/

In this case, yes, but in general it's a lot more use if you can isolate a
_compilable_ section of code that demonstrates problems: it's a lot easier
to figure out what the problem is if I can actually build and run the
thing!


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk
Beauty is a French phonetic corruption of a short cloth neck ornament

- Raw text -


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