Some OpenGL optimization and state-change reduction.
[neverball] / ball / hud.c
index ac00a11..4ee9e29 100644 (file)
@@ -51,6 +51,9 @@ static void hud_fps(void)
 
     if (now - then > 250)
     {
+        if (count)
+            fprintf(stdout, "%f\n", (float) (now - then) / count);
+
         fps   = count * 1000 / (now - then);
         then  = now;
         count = 0;
@@ -130,10 +133,12 @@ void hud_paint(void)
 
     if (mode == MODE_CHALLENGE)
         gui_paint(Lhud_id);
+
     if (mode == MODE_PRACTICE)
         gui_paint(Rhud2_id);
     else
         gui_paint(Rhud_id);
+
     gui_paint(time_id);
 
     if (config_get_d(CONFIG_FPS))