#ifndef COLOR_H #define COLOR_H #include GLfloat ColorTable[][3] = { { 0.0, 0.0, 0.0 }, { 1.0, 0.0, 0.0 }, { 0.0, 1.0, 0.0 }, { 0.0, 0.0, 1.0 }, { 1.0, 1.0, 0.0 }, { 1.0, 0.0, 1.0 }, { 0.0, 1.0, 1.0 }, { 1.0, 1.0, 1.0 }, }; enum COLOR_TABLE_INDEX { COLOR_BLACK = 0, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE, COLOR_UNKNOWN }; GLfloat * color_rotate() { static int index = COLOR_BLACK; index = (index + 1) % COLOR_WHITE; return ColorTable[index]; } #endif