OpenGL not mandatory

This commit is contained in:
Krishna Vedala
2020-07-07 09:48:17 -04:00
parent ded46a2fd8
commit e56539ea73
2 changed files with 42 additions and 31 deletions

View File

@@ -112,6 +112,7 @@ void test() {
fp.close();
}
#ifndef NO_OPENGL
/** A wrapper that is not available in all GLUT implementations.
*/
static inline void glutBitmapString(void *font, char *message) {
@@ -211,13 +212,14 @@ void timer_cb(int t) {
glutTimerFunc(25, timer_cb, 0);
glutPostRedisplay();
}
#endif
} // namespace spirograph
/** Main function */
int main(int argc, char **argv) {
spirograph::test();
#ifndef NO_OPENGL
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow("Spirograph");
@@ -226,6 +228,7 @@ int main(int argc, char **argv) {
glutTimerFunc(25, spirograph::timer_cb, 0);
glutDisplayFunc(spirograph::test2);
glutMainLoop();
#endif
return 0;
}