delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/09/18:37:07

Message-Id: <199808092219.XAA22672@sable.ox.ac.uk>
Comments: Authenticated sender is <mert0407 AT sable DOT ox DOT ac DOT uk>
From: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
To: Endlisnis <s257m AT unb DOT ca>
Date: Sun, 9 Aug 1998 23:18:06 +0000
MIME-Version: 1.0
Subject: Re: Text and graphics?
Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk
CC: djgpp AT delorie DOT com

On  9 Aug 98 at 15:54, Endlisnis wrote:

> Nate Eldredge wrote:
> 
> > Einar wrote:
> > What the hey?  `scanf' is for reading, not writing, so obviously you
> > can't write anything using it.  Furthermore, it's unlikely to work right
> > in a graphics mode; you'll have to use Allegro's features for that.
> 
>     As long as you are in an 8bbp mode, printf should work fine.

Personally I'd rather not rely on it.  It's unpredictable where the 
text will be printed, and you don't have as much control.

> > If you want to put text on the screen, try `sprintf' followed by
> > `textout'.
> 
>     Why not just a printf, or cout?  Why call 2 functions when you only need
> to call one?

`textout' is more powerful, e.g. it can use various fonts and colours
and can put the text at a specific location on the screen. In any
case, Allegro provides a function (`textprintf') that does a
`sprintf' followed by a `textout' for you. 

-- 
george DOT foot AT merton DOT oxford DOT ac DOT uk

- Raw text -


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