getmcolor()

David R. Blythe drb at eecg.toronto.edu
Sat Feb 23 10:48:03 AEST 1991


In article <1991Feb22.151942.26855 at ux1.cso.uiuc.edu> marcc at yoyodyne.ncsa.uiuc.edu (Marc Cooper) writes:
>In article <1991Feb21.223016.8843 at jarvis.csri.toronto.edu> drb at eecg.toronto.edu (David R. Blythe) writes:
>>getmcolor() doesn't appear to work in RGB mode (it returns 0's).
...
>>around, but someone may want to fix it (if its fixable). 4D/70GT running
>>3.3.1.
>
>
>When I converted an 8-bit program to 24 bit, I used getmcolor() frequently and
>it worked like a charm.  It allowed me to still keep the colormap manipulation
>I wanted and use lighting...  Make sure you're using pointers:
>
>short r,g,b;
>int index;
>
>getmcolor(index, &r, &g, &b);
>
>
>Other than that, there shouldn't be a problem.  I running it nicely on a PI 
>using 3.3.1

My test program looks like this:

#include <gl/gl.h>
main() {
    int i;
    short b[3];

    winopen("");
    RGBmode();
    gconfig();
    for(i = 0; i < 1000; i++) {
	getmcolor(i, b, b+1, b+2);
	printf("%d  %x %x %x\n", i, b[0], b[1], b[2]);
    }
}

It returns all zeros.  I fixed my application by having it call cmode()
before calling getmcolor().  This is a 4D/70GT running 3.3.1
	-drb



More information about the Comp.sys.sgi mailing list