1 #include "config.h"
2 
3 #include <cppunit/TextTestRunner.h>
4 #include <cppunit/extensions/TestFactoryRegistry.h>
5 
6 #if defined HAVE_GL_GLUT_H
7 #   include <GL/glut.h>
8 #elif defined HAVE_GLUT_GLUT_H
9 #   include <GLUT/glut.h>
10 #else
11 #   error GLUT headers not present
12 #endif
13 
main(int argc,const char * argv[])14 int main(int argc, const char* argv[])
15 {
16     CppUnit::TextTestRunner runner;
17     runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
18 
19     runner.run();
20 
21     return 0;
22 }
23 
24 
buildGLContext()25 void buildGLContext()
26 {
27     static bool glutInitialised = false;
28     char* pointer;
29     int number;
30 
31     if(!glutInitialised)
32     {
33         glutInit(&number, &pointer);
34         glutInitDisplayMode(GLUT_DEPTH | GLUT_RGB | GLUT_DOUBLE | GLUT_MULTISAMPLE);
35         glutInitWindowPosition(0, 0);
36         glutInitWindowSize(150, 150);
37         glutCreateWindow("FTGL TEST");
38 
39         glMatrixMode(GL_PROJECTION);
40         glLoadIdentity();
41         gluOrtho2D(0.0, 150, 0.0, 150);
42         glMatrixMode(GL_MODELVIEW);
43         glLoadIdentity();
44 
45         glutInitialised = true;
46     }
47 }
48 
49