Skip to content

Commit

Permalink
add FPS counter when F8 is pressed for debugging purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
jamet committed Jun 27, 2015
1 parent 7a999d3 commit 7411ecc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ofApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,11 @@ void ofApp::draw()
splashImg2.draw(((ofGetWidth()/2)-340),((ofGetHeight()/2)-400));
ofDisableAlphaBlending();
}

if (bshowFPS)
{
ofDrawBitmapString("FPS: " + ofToString(int(ofGetFrameRate())),20,ofGetHeight()-40);
}
}


Expand Down Expand Up @@ -1774,6 +1779,9 @@ void ofApp::keyPressed(int key)
quads[activeQuad].video.isPaused();
}

if ( key == OF_KEY_F8){
bshowFPS = ! bshowFPS;
}

}

Expand Down
1 change: 1 addition & 0 deletions src/ofApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class ofApp : public ofBaseApp
bool gridSetup;
bool bCameraOk;
bool bSnapOn;
bool bshowFPS;

ofImage splashImg;
ofImage splashImg2;
Expand Down

0 comments on commit 7411ecc

Please sign in to comment.