www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/05/22:20:30

From: goren AT shani DOT net (Nave Goren)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Total newbie question
Date: Tue, 05 Aug 1997 17:06:54 GMT
Organization: WESAYSO Corp.
Lines: 26
Message-ID: <33e75373.3392190@news.shani.net>
References: <33E68F08 DOT 1CE4 AT sprintmail DOT com>
NNTP-Posting-Host: teleport94.shani.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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