Mail Archives: djgpp/1997/12/08/14:31:23
Steve Patton wrote:
>
> > Sorry to ask such an obvious question, but I've new to C/DJGPP and just
> > starting graphics work. But, Anyway does anyone know how to :
> > 1 .Switch from text to graphics mode using DJGPP
> > 2. Change a single pixel from "OFF" to "ON"
> > Thanks in advance
>
> To switch from text to graphics mode. I'm assuming you're meaning VGA
> 320x200x256
>
> __dpmi_regs r;
>
> r.ax = 0x0013;
>
> __dpmi_int ( 0x10, &r );
>
> // if you get an error, you are either missing a header file, or there is
> one too many, or too little _ , you can
> // look it up in LIBC.INF out of C:/DJGPP/INFO directory to make sure.
>
> To place a single pixel ( in that same mode)
>
> int x, y, c;
>
> x = 3; // x
> y = 5; // y
> c = 15; // color value
>
> _farpokeb ( _dos_ds, 0xA0000 + x + (y*320), c );
>
> That requires an odd header file, it might be <sys\farptr.h>, but you
> should look it up in LIBC.INF as well. That's the second fastest way I
> know how to. (The fastest way I know how, requires disabling protected
> memory, and is more complicated to get started)
>
> Hope that helps! But I recommend you do try getting the Allegro library.
> It has many of the functions and more, and is pretty fast for a library.
> Here's the address to Allegro home page
>
> http://www.talula.demon.co.uk/allegro/
>
> -Steve
use _farpokeb ( _dos_ds, 0xA0000 + x + (y << 8) + (y << 6), c );
insted is't faster.
- Raw text -