8 static void display(void);
9 static void keypress(unsigned char key, int x, int y);
10 static void mouse(int bn, int st, int x, int y);
12 static long start_time;
15 int main(int argc, char **argv)
17 glutInit(&argc, argv);
18 glutInitWindowSize(1280, 800);
19 glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
20 glutCreateWindow("Mindlapse");
22 glutDisplayFunc(display);
23 glutIdleFunc(glutPostRedisplay);
24 glutReshapeFunc(demo_reshape);
25 glutKeyboardFunc(keypress);
27 glutMotionFunc(demo_motion);
29 if(demo_init() == -1) {
34 start_time = glutGet(GLUT_ELAPSED_TIME);
39 static void display(void)
41 demo_time_msec = glutGet(GLUT_ELAPSED_TIME) - start_time;
46 assert(glGetError() == GL_NO_ERROR);
49 static void keypress(unsigned char key, int x, int y)
51 if(key == 27) exit(0);
53 demo_keyboard(key, 1);
56 static void mouse(int bn, int st, int x, int y)
58 int bidx = bn - GLUT_LEFT_BUTTON;
59 int press = st == GLUT_DOWN;
61 demo_mouse(bidx, press, x, y);