www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/30/18:23:01

From: "Thomas Harte" <T DOT Harte AT btinternet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: graphics
Date: 30 Dec 1996 20:18:05 GMT
Organization: Dell Computer Corporation
Lines: 24
Message-ID: <01bbf68d$e5e607e0$cc2549c2@default>
References: <1 DOT 5 DOT 4 DOT 16 DOT 19961218230509 DOT 19f7ab66 AT mail DOT algonet DOT se> <5a4pjc$5b2 AT nr1 DOT vancouver DOT istar DOT net>
NNTP-Posting-Host: host-73-37-204.btinternet.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp


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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019