From: Andreas Burman Newsgroups: comp.os.msdos.djgpp Subject: Re: Newbie Needs Help Date: Thu, 04 Dec 1997 11:29:17 -0800 Organization: Balderskolan Skelleftea Lines: 45 Message-ID: <3487048D.52B9@ba.ssdn.skelleftea.se> References: <19971129 DOT 101142 DOT 16006 DOT 1 DOT matthew DOT krause AT juno DOT com> <65n24n$q6h AT bgtnsc03 DOT worldnet DOT att DOT net> NNTP-Posting-Host: news.skelleftea.se Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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 , 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.