9 unsigned long start_msec, time_msec, num_frames;
11 static void keyboard(int key, int pressed, void *cls);
12 static void mouse(int bn, int pressed, int x, int y, void *cls);
13 static void motion(int x, int y, void *cls);
16 static int xsz, ysz, depth;
23 fbgfx_save_video_mode();
24 if(!(vmem = fbgfx_get_video_mode(&xsz, &ysz, &depth))) {
28 /*if(!(vmem = fbgfx_set_video_mode(xsz, ysz, 16))) {
31 fbgfx_get_video_mode(&xsz, &ysz, &depth);
33 fprintf(stderr, "failed to set color depth: 16bpp\n");
36 if(fbev_init() == -1) {
39 fbev_keyboard(keyboard, 0);
40 fbev_mbutton(mouse, 0);
41 fbev_mmotion(motion, 0);
43 if(init_tunnel(xsz, ysz, depth) == -1) {
47 start_msec = get_time_msec();
52 time_msec = get_time_msec() - start_msec;
58 time_msec = get_time_msec() - start_msec;
62 fbgfx_restore_video_mode();
63 if(num_frames && time_msec) {
64 printf("\ravg framerate: %.1f\n", (float)num_frames / ((float)time_msec / 1000.0));
69 static void keyboard(int key, int pressed, void *cls)
82 static void mouse(int bn, int pressed, int x, int y, void *cls)
86 static void motion(int x, int y, void *cls)