Mail Archives: djgpp/1999/05/31/21:12:43
Lars S. Loevlie wrote:
>
> Can anyone explain to me (in a very basic way) how to use the
> putpixel-method in djgpp c, and wether writing directly to video-memory
> is actually risky or not? Some say it is and some say not...
Find out where it video memory you need to poke your byte, and write it
with `_farpokeb'. For example, mode 0x13 is 320x200 256 colors, so
`_farpokeb(_dos_ds, 0xA0000 + (y * 320) + x, c)'.
Writing to video memory is not risky per se; the risk comes if you miss
and write to some other kind of memory :) In the above example, it
might be wise (while debugging) to check that y < 200 and x < 320, and
that you have the right number of zeros in 0xA0000.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -