Mail Archives: djgpp/1998/08/09/18:37:07
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 -