00001
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <cstdlib>
00026 #include <config.h>
00027 #include <GL/glut.h>
00028
00029 #include "Display.h"
00030
00031
00032
00033
00034
00035
00036
00040 void display_init() {
00041 Display::instance()->init();
00042 }
00043
00047 void display_quit() {
00048 Display::instance()->quit();
00049 }
00050
00054 void display_draw() {
00055 Display::instance()->draw();
00056 }
00057
00064 void display_reshape(int width, int height) {
00065 Display::instance()->reshape(width, height);
00066 }
00067
00075 void display_inputKey(unsigned char key, int x, int y) {
00076 Display::instance()->inputKey(key, x, y);
00077 }
00078
00087 void display_inputMouse(int button, int state, int x, int y) {
00088 Display::instance()->inputMouse(button, state, x, y);
00089 }
00090
00097 int main(int argc, char *argv[]) {
00098 int win;
00099
00100 glutInit(&argc, argv);
00101 glutInitDisplayMode(GLUT_DEPTH | GLUT_ACCUM | GLUT_RGBA | GLUT_DOUBLE);
00102 glutInitWindowSize(1024,768);
00103 glutInitWindowPosition(0, 0);
00104 win = glutCreateWindow(PACKAGE " " VERSION);
00105 glutDisplayFunc(display_draw);
00106 glutFullScreen();
00107 glutReshapeFunc(display_reshape);
00108 glutKeyboardFunc(display_inputKey);
00109 glutMouseFunc(display_inputMouse);
00110 display_init();
00111 atexit(display_quit);
00112 glutMainLoop();
00113
00114 return 0;
00115 }