Mail Archives: djgpp/1996/12/30/18:23:01
Aleksi Kallio <aleksi AT kalliot DOT pp DOT fi> wrote in article
<5a4pjc$5b2 AT nr1 DOT vancouver DOT istar DOT net>...
> >I know how to use graphics in Borland: initgraph(.......
> >bgi-graphics don=B4t work whit djgpp for me so how do you do it?
[cut]
> Then draw pixels in this way:
> #include<go32.h>
> #include<sys/farptr.h>
> _farpokeb(_dos_ds, 0xA0000+y*320+x, color);
I wrote it somewhere else, but for anyone who only reads this message, I
just wanted to add that you can use a shortcut based on the fact that
256+64 = 320, that 2 to the power of 8 is 256 and 2 to the power of 6 is
64, and that binary is based around two options. Therefore, using the
correct bit-shifts, you can change the line to :-
_farpokeb(_dos_ds, 0xA0000 + (y << 8) + (y << 6) + x, colour);
. . . .which is faster.
-Thomas
- Raw text -