Path: utzoo!utgpu!news-server.csri.toronto.edu!eecg.toronto.edu!drb Newsgroups: comp.sys.sgi From: drb@eecg.toronto.edu (David R. Blythe) Subject: Re: getmcolor() Message-ID: <1991Feb22.184803.16561@jarvis.csri.toronto.edu> Keywords: surprises Organization: EECG, University of Toronto References: <1991Feb21.223016.8843@jarvis.csri.toronto.edu> <1991Feb22.151942.26855@ux1.cso.uiuc.edu> Date: 22 Feb 91 23:48:03 GMT Lines: 40 In article <1991Feb22.151942.26855@ux1.cso.uiuc.edu> marcc@yoyodyne.ncsa.uiuc.edu (Marc Cooper) writes: >In article <1991Feb21.223016.8843@jarvis.csri.toronto.edu> drb@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 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 Brought to you by Super Global Mega Corp .com