7 static void display(void);
8 static void keypress(unsigned char key, int x, int y);
9 static void mouse(int bn, int st, int x, int y);
11 static long start_time;
14 int main(int argc, char **argv)
16 glutInit(&argc, argv);
17 glutInitWindowSize(1280, 800);
18 glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
19 glutCreateWindow("Mindlapse");
21 glutDisplayFunc(display);
22 glutIdleFunc(glutPostRedisplay);
23 glutReshapeFunc(demo_reshape);
24 glutKeyboardFunc(keypress);
26 glutMotionFunc(demo_motion);
28 if(demo_init() == -1) {
33 start_time = glutGet(GLUT_ELAPSED_TIME);
38 static void display(void)
40 demo_time_msec = glutGet(GLUT_ELAPSED_TIME) - start_time;
45 assert(glGetError() == GL_NO_ERROR);
48 static void keypress(unsigned char key, int x, int y)
50 if(key == 27) exit(0);
52 demo_keyboard(key, 1);
55 static void mouse(int bn, int st, int x, int y)
57 int bidx = bn - GLUT_LEFT_BUTTON;
58 int press = st == GLUT_DOWN;
60 demo_mouse(bidx, press, x, y);