Added a function to construct a gl context. Required for some tests
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
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