www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/22/02:30:19

From: Hartmut Schirmer <hsc AT techfak DOT uni-kiel DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help with GRX20
Date: Mon, 22 Jun 1998 08:08:19 +0200
Organization: Technische Fakultaet der CAU zu Kiel, Germany
Lines: 50
Message-ID: <358DF4D3.91A73CE8@techfak.uni-kiel.de>
References: <358DF8FB DOT 3358565A AT bellatlantic DOT net>
NNTP-Posting-Host: zora.techfak.uni-kiel.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Donn Miller wrote:
> 
> 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.

If it's really VGA compatible, you should get 360x480x256 at most.
On DOS systems and if your card has a VESA compatible bios, use the VESA
driver:

  set GRX20DRV=VESA

> 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.

The third argument is the color value. By default 256 color modes use a
palette scheme. Use GrSetRGBcolorMode() to switch to RGB mode.
Use GrBuildRGBcolorT(r,g,b) (truncates) or
GrBuildRGBcolorR(r,g,b)(rounds) for RGB->color value translation.

> 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?

Don't know. You should have a look at the sources.

Hartmut
-- 
Hartmut Schirmer                   | Phone: +49-431-77572-709  FAX:-703
Automatisierungs- & Regelungstech. | hsc AT techfak DOT uni-kiel DOT de
Technische Fakult"at,              | http://www.techfak.uni-kiel.de/~hsc
Kaiserstr. 2, 24143 Kiel, Germany  | PGP key via WWW, Key ID:6D84AEC1

- Raw text -


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