]> git.mxchange.org Git - flightgear.git/blobdiff - tests/test-env-map.cxx
Boo, typo.
[flightgear.git] / tests / test-env-map.cxx
index 209971e3c37ac5c0ae91e2a8821bf20f0752fccb..0cb13dee982901375392fe742b42402df6a8f89e 100644 (file)
@@ -1,11 +1,30 @@
-#include <GL/glut.h>
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <math.h>
 
+#include <simgear/compiler.h>
+#if defined( __APPLE__)
+# include <OpenGL/OpenGL.h>
+# include <GLUT/glut.h>
+#else
+# include <GL/gl.h>
+# ifdef HAVE_GLUT_H
+#  include <GL/glut.h>
+# endif
+#endif
+
 #define TEXRES_X 256
 #define TEXRES_Y 256
 
+#ifdef HAVE_GLUT_H
 unsigned char env_map[TEXRES_X][TEXRES_Y][4];
 GLuint texName;
 int window_x = 640, window_y = 480;
@@ -231,9 +250,11 @@ void keyboard (unsigned char key, int x, int y)
     break;
   }
 }
+#endif /* HAVE_GLUT_H */
 
 int main(int argc, char** argv)
 {
+#ifdef HAVE_GLUT_H
   glutInitWindowSize(window_x, window_y);
   glutInit(&argc, argv);
   glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
@@ -244,6 +265,10 @@ int main(int argc, char** argv)
   glutKeyboardFunc(keyboard);
 
   glutMainLoop();
+#else
+
+  printf("GL Utility Toolkit (glut) was not found on this system.\n");
+#endif
 
   return 0;
 }