getmcolor() on VGX's

Marc Cooper marcc at yoyodyne.ncsa.uiuc.edu
Tue Jun 25 00:29:30 AEST 1991




Here's an interesting little problem:


It was recently my pleasure (right) to convert an 8 bit GL program to 24 bit.
Wanting to take the path of least resistence, thus freeing me from redoing
all the nifty pallette manipulation stuff that was already there, I 
simply wrote a routine I called rbgcolor() that took the place of color()


It looks something like the following:

rbgcolor(int index)
{
	short r,g,b;

	getmcolor(index,&r,&g,&b);
	RGBcolor(r,g,b);
}


wallah!  24 bit color! (This was madified to do lighting and depthcuing and 
other stuff, so it isn't quite as pointless as it looks..)

Anyway, it works just fine on my PI.  But when I go run it on a VGX, the
r,g, and b values all come back 0.  There was something in the manual about the
last 256 entries in the map being used for gamma corrections, but I'm starting
my map at 512 (just after the system colors).  And again, this works just fine
on a PI.  It fails on VGX machines.

Any hints, clues, etc?

-Marc Cooper
 marcc at ncsa.uiuc.edu




More information about the Comp.sys.sgi mailing list