added the capability to crudely resize images by half in image.cc
[laserbrain_demo] / src / app.cc
index ca750fa..e135ddf 100644 (file)
@@ -574,6 +574,7 @@ static void toggle_flight()
 
 static void calc_framerate()
 {
+       static int ncalc;
        static int nframes;
        static long prev_upd;
 
@@ -582,6 +583,11 @@ static void calc_framerate()
                framerate = (float)nframes / (float)(elapsed * 0.001);
                nframes = 1;
                prev_upd = time_msec;
+
+               if(++ncalc >= 5) {
+                       printf("fps: %f\n", framerate);
+                       ncalc = 0;
+               }
        } else {
                ++nframes;
        }