www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/31/20:00:44

Newsgroups: comp.os.msdos.djgpp
From: cp386 AT torfree DOT net (Sivathanu A. Pillai)
Subject: LIBGRX
Message-ID: <E3Ax6t.L46.0.queen@torfree.net>
Organization: Toronto Free-Net
Date: Tue, 31 Dec 1996 23:28:05 GMT
Lines: 28
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hi,
How do I set the graphics mode to 640x480x256, and then draw 256 bars 
(filled boxes) that go from one end of the monitor to the other?  Such as 
a gradient.  Here's my code (all req. headres are incl. in the original).
The most trouble I have is, is setting up the graphics.  Isn't there a 
#define that simplifies all this (esp. the last 3 args. in GrSetMode())?

void main()
 {
   int x; long fbc;
    GrSetMode(GR_width_height_graphics,640,480,256);
 
    for(x=0;x<=256;x++)
    {
    fbc=GrAllocColor(x,x,x); 
    GrFilledBox(x+1,0,x+2,480,fbc); 
    }
    getch(); 
 }

All I need is a simple gradient.  Please help!


Thanks! 
Gautam N. Lad <gautam AT interlog DOT com>
              http://www.interlog.com/~gautam
-- 

- Raw text -


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