delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/21/23:30:58

From: Donn Miller <dmm125 AT bellatlantic DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Help with GRX20
Date: Sun, 21 Jun 1998 23:26:04 -0700
Organization: Bell Atlantic Internet Solutions
Lines: 31
Message-ID: <358DF8FB.3358565A@bellatlantic.net>
NNTP-Posting-Host: client201-122-29.bellatlantic.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I'm having problems using GRX20.  First, I can get 640x480 resolution,
but it only gives me 16 colors.  To get 256 colors, I can only get
320x200 resolution, even though I'm using stdvga.  My video card (SiS
5598) is unsupported.

Second, I'd like to know how to display output in terms of RGB values.
I've got code that looks like this:

void display(int x, int y, int r, int g, int b)
{
    /* quick and dirty way to transform RGB values into colormap */
    int rgb;
    r = (7<<5)&r;
    g = (7<<2)&g;
    b = (3)&b;
    rgb = r | g | b;
    GrPlot(x, y, rgb);
}

Actually, I'd just like to find out what the 3rd argument to GrPlot()
really means, since it's a value from [0-255].  How is its value
determined, is it some sort of ANSI colormap or RGB value?  Also, when
using programs like cshow, I can get 640x480x256 just by using what
seems to be a generic VGA mode.

Most of the terminal mode graphics packages like GRX, BGI, and FreeBSD's
libvgl seem to only be able to get 16 colors in 640x480 mode.  Maybe
programs like cshow program the VGA controller directly?

    Donn

- Raw text -


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