projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added the capability to crudely resize images by half in image.cc
[laserbrain_demo]
/
src
/
app.cc
diff --git
a/src/app.cc
b/src/app.cc
index
ca750fa
..
e135ddf
100644
(file)
--- a/
src/app.cc
+++ b/
src/app.cc
@@
-574,6
+574,7
@@
static void toggle_flight()
static void calc_framerate()
{
static void calc_framerate()
{
+ static int ncalc;
static int nframes;
static long prev_upd;
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;
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;
}
} else {
++nframes;
}