Mail Archives: djgpp/1996/12/23/21:06:05
Tony O'Bryan wrote:
>
> > Now I want to printf text in the graphics mode, but it does not work, why?
>
> Maybe djgpp's printf() writes directly to text screen memory, which is
> at a different address than graphics memory.
printf() does not write to any kind of memory; it simply writes to the
stdout file descriptor. DOS then determines where that file descriptor
goes. Normally, it goes to the CON: device, which results in the text
being sent to the BIOS for display on the console screen. Since neither
DOS nor the BIOS know or care what video mode you are in, this will not
work in graphics modes.
You may say, "But this works in Pascal!" That's because Pascal is
designed as a beginner's programming language, and thus has lots of
little gimmicks to help you out. Normally, the video screen and the
text screen reside in totally separate and independent areas of memory.
Each graphics package has its own functions to display text on the
graphics screen. You will have to look up the docs for that package to
see how to do it.
BTW, the <conio.h> functions won't work either; all they do is bypass
DOS and write to video memory directly.
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | mailto:fighteer AT cs DOT com |
| God's final message to His Creation: | http://www.cs.com/fighteer |
| "We apologize for the inconvenience."| Fight against proprietary |
| - Douglas Adams | software - support the FSF!|
---------------------------------------------------------------------
- Raw text -