Mail Archives: djgpp/1997/08/05/22:20:30
On Mon, 04 Aug 1997 19:25:12 -0700, Ionicis <anfamily AT sprintmail DOT com>
wrote:
>Ok, how do you even put a stinkin' white pixel on the screen with djgpp
>(using C) without any gfx libs? Please post the source code, hehe.
>I've only been programming for about 3 months, so, you know.
Well, as I've only been using DJGPP for a couple of weeks this is
probably not the most efficient way to do it (it's certainly not
optimized, on purpose), but this is how I do it:
Assming you're in mode 13h for simplicity, and you want to plot a
pixel at coordinates (x,y) in color 'color':
#include <sys/farptr.h>
#include <go32.h>
_farpokeb(_dos_ds, 0xa0000 + y*320 + x, color);
I think 15 is white for the default palette.
That's it. Hope this helps,
Nave Goren <goren AT shani DOT net>
"Have we come this fa-fa-fa to find a soul cliche?" -Elvis C.
- Raw text -