132001f49Smrg 232001f49Smrgenum { 332001f49Smrg COLOR_BLACK = 0, 432001f49Smrg COLOR_RED, 532001f49Smrg COLOR_GREEN, 632001f49Smrg COLOR_YELLOW, 732001f49Smrg COLOR_BLUE, 832001f49Smrg COLOR_MAGENTA, 932001f49Smrg COLOR_CYAN, 1032001f49Smrg COLOR_WHITE 1132001f49Smrg}; 1232001f49Smrg 1332001f49Smrgstatic float RGBMap[9][3] = { 1432001f49Smrg {0, 0, 0}, 1532001f49Smrg {1, 0, 0}, 1632001f49Smrg {0, 1, 0}, 1732001f49Smrg {1, 1, 0}, 1832001f49Smrg {0, 0, 1}, 1932001f49Smrg {1, 0, 1}, 2032001f49Smrg {0, 1, 1}, 2132001f49Smrg {1, 1, 1}, 2232001f49Smrg {0.5, 0.5, 0.5} 2332001f49Smrg}; 2432001f49Smrg 2532001f49Smrgstatic void SetColor(int c) 2632001f49Smrg{ 2732001f49Smrg if (glutGet(GLUT_WINDOW_RGBA)) 2832001f49Smrg glColor3fv(RGBMap[c]); 2932001f49Smrg else 3032001f49Smrg glIndexf(c); 3132001f49Smrg} 3232001f49Smrg 3332001f49Smrgstatic void InitMap(void) 3432001f49Smrg{ 3532001f49Smrg int i; 3632001f49Smrg 3732001f49Smrg if (rgb) 3832001f49Smrg return; 3932001f49Smrg 4032001f49Smrg for (i = 0; i < 9; i++) 4132001f49Smrg glutSetColor(i, RGBMap[i][0], RGBMap[i][1], RGBMap[i][2]); 4232001f49Smrg} 43