no-thread option, coalesced tunnel lut, more accurate fps counter
[fbgfx] / src / main.c
index 1cd4950..7c41e2e 100644 (file)
@@ -19,7 +19,7 @@ static int quit;
 
 int main(void)
 {
-       int i, trybpp[] = {32, 24, 16, 0};
+       int i, trybpp[] = {16, 32, 24, 16, 0};
 
        fbgfx_save_video_mode();
        fbgfx_get_video_mode(&fb_width, &fb_height, &fb_depth);
@@ -50,7 +50,7 @@ int main(void)
                goto end;
        }
        scr_change(scr_lookup("console"), 0);
-       scr_change(scr_lookup("tunnel"), 2000);
+       scr_change(scr_lookup("tunnel"), 4000);
 
        start_msec = get_time_msec();
        for(;;) {
@@ -61,7 +61,9 @@ int main(void)
 
                scr_update();
                scr_draw();
-               ++num_frames;
+               if(time_msec >= 4000) {
+                       ++num_frames;
+               }
        }
 
        time_msec = get_time_msec() - start_msec;
@@ -70,7 +72,7 @@ end:
        fbev_shutdown();
        fbgfx_restore_video_mode();
        if(num_frames && time_msec) {
-               printf("\ravg framerate: %.1f\n", (float)num_frames / ((float)time_msec / 1000.0));
+               printf("\ravg framerate: %.1f\n", (float)num_frames / ((float)(time_msec - 4000) / 1000.0));
        }
        return 0;
 }