#ifndef COLOR_H #define COLOR_H #ifdef __APPLE__ #include #else #include #endif #include GLfloat ColorTable[][3] = { { 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_RED = 0, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN, COLOR_WHITE, COLOR_UNKNOWN }; GLfloat * color_rotate() { static int index = COLOR_RED; index = (index + 1) % COLOR_WHITE; return ColorTable[index]; } GLfloat * color_random() { return ColorTable[rand() % COLOR_UNKNOWN]; } #endif