Mail Archives: djgpp/2000/08/11/11:45:26
mpolve AT tin DOT it (ClaudioF) wrote in <8mu28b$202$1 AT nslave1 DOT tin DOT it>:
You might benefit from taking a look at simpld at
http://www.unur.com/howto/c-examples.html. It demonstrates how to get into VGA
mode 0x13, and use far pointers under djgpp to write your putpixel.
After you feel comfortable with that, however, I suggest you download Allegro.
...
>void PutPixel (int x, int y, char color)
> {
> unsigned char *ScreenPointer;
>
> ScreenPointer = (unsigned char *) 0x0a0000;
> memset (ScreenPointer+(x + (y*320)), color, 1); //
> Here's
>the problem. I can't resolve it
> }
...
that is because, in protected mode, the screen resides in a different address
space than the data segment of you program.
besides, it seems rather wasteful to use a block copy function to set a single
address locations.
Sinan.
--
--------------------------------
A. Sinan Unur
http://www.unur.com/
- Raw text -