Commit bf7497fb6cd96c6b9707783caaf3e1c91618122e

henry 2004-09-28T02:39:58

Added a function to construct a gl context. Required for some tests

diff --git a/test/TestMain.cpp b/test/TestMain.cpp
index b76cb3e..579f471 100755
--- a/test/TestMain.cpp
+++ b/test/TestMain.cpp
@@ -1,6 +1,12 @@
 #include <cppunit/TextTestRunner.h>
 #include <cppunit/extensions/TestFactoryRegistry.h>
 
+#ifdef __APPLE_CC__
+	#include <GLUT/glut.h>
+#else
+	#include <GL/glut.h>
+#endif
+
 int main(int argc, const char* argv[])
 {
     CppUnit::TextTestRunner runner;
@@ -10,3 +16,22 @@ int main(int argc, const char* argv[])
 
     return 0;
 }
+
+
+void buildGLContext()
+{
+	static bool glutInitialised = false;
+    char* pointer;
+    int number;
+    
+    if( !glutInitialised)
+    {
+        glutInit( &number, &pointer);
+        glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_DOUBLE | GLUT_MULTISAMPLE);
+        glutInitWindowPosition(0, 0);
+        glutInitWindowSize( 0, 0);
+        glutCreateWindow("FTGL TEST");
+        
+        glutInitialised = true;
+    }
+}
\ No newline at end of file