uncrustify
This commit is contained in:
parent
0b8fb261fa
commit
fa1d70e6a5
4 changed files with 189 additions and 178 deletions
|
@ -88,6 +88,7 @@
|
||||||
# Note: Leave a leading space when adding list items with the += operator
|
# Note: Leave a leading space when adding list items with the += operator
|
||||||
################################################################################
|
################################################################################
|
||||||
# PROJECT_DEFINES =
|
# PROJECT_DEFINES =
|
||||||
|
PROJECT_DEFINES = OFX_PROFILER=1
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# PROJECT CFLAGS
|
# PROJECT CFLAGS
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "ofApp.h"
|
#include "ofApp.h"
|
||||||
|
#include "ofAppRunner.h"
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
void ofApp::setup(){
|
void ofApp::setup(){
|
||||||
|
@ -6,7 +7,7 @@ void ofApp::setup() {
|
||||||
OFX_PROFILER_FUNCTION();
|
OFX_PROFILER_FUNCTION();
|
||||||
|
|
||||||
ofBackgroundHex(0x57554c);
|
ofBackgroundHex(0x57554c);
|
||||||
ofSetFrameRate(60);
|
//ofSetFrameRate(60);
|
||||||
ofSetVerticalSync(true);
|
ofSetVerticalSync(true);
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,8 +22,8 @@ void ofApp::setup() {
|
||||||
void ofApp::update(){
|
void ofApp::update(){
|
||||||
OFX_PROFILER_FUNCTION();
|
OFX_PROFILER_FUNCTION();
|
||||||
// add points all the time
|
// add points all the time
|
||||||
if(points.size() < 500000) {
|
if(points.size() < 500000 || ofGetFrameRate() > 30){
|
||||||
for (int i=0; i<30; i++) {
|
for(int i = 0; i < 300; i++){
|
||||||
addPoint(ofGetWidth() / 2, ofGetHeight() / 2);
|
addPoint(ofGetWidth() / 2, ofGetHeight() / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,10 +43,18 @@ void ofApp::update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrap the screenhttps://profiler.firefox.com/from-file/calltree/?v=4
|
// wrap the screenhttps://profiler.firefox.com/from-file/calltree/?v=4
|
||||||
if(points[i].x > ofGetWidth()) points[i].x = 1;
|
if(points[i].x > ofGetWidth()){
|
||||||
if(points[i].x < 0) points[i].x = ofGetWidth()-1;
|
points[i].x = 1;
|
||||||
if(points[i].y > ofGetHeight()) points[i].y = 1;
|
}
|
||||||
if(points[i].y < 0) points[i].y = ofGetHeight()-1;
|
if(points[i].x < 0){
|
||||||
|
points[i].x = ofGetWidth() - 1;
|
||||||
|
}
|
||||||
|
if(points[i].y > ofGetHeight()){
|
||||||
|
points[i].y = 1;
|
||||||
|
}
|
||||||
|
if(points[i].y < 0){
|
||||||
|
points[i].y = ofGetHeight() - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,7 +78,6 @@ void ofApp::draw() {
|
||||||
glEnd();
|
glEnd();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// a bit faster
|
// a bit faster
|
||||||
else if(mode == 2){
|
else if(mode == 2){
|
||||||
OFX_PROFILER_SCOPE("mode 2");
|
OFX_PROFILER_SCOPE("mode 2");
|
||||||
|
@ -80,7 +88,6 @@ void ofApp::draw() {
|
||||||
glDrawArrays(GL_POINTS, 0, (int)points.size());
|
glDrawArrays(GL_POINTS, 0, (int)points.size());
|
||||||
glDisableClientState(GL_VERTEX_ARRAY);
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
// super fast (vbo)
|
// super fast (vbo)
|
||||||
else if(mode == 3){
|
else if(mode == 3){
|
||||||
OFX_PROFILER_SCOPE("mode 3");
|
OFX_PROFILER_SCOPE("mode 3");
|
||||||
|
@ -108,9 +115,15 @@ void ofApp::exit() {
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
void ofApp::keyPressed(int key){
|
void ofApp::keyPressed(int key){
|
||||||
|
|
||||||
if(key == '1') mode = 1;
|
if(key == '1'){
|
||||||
if(key == '2') mode = 2;
|
mode = 1;
|
||||||
if(key == '3') mode = 3;
|
}
|
||||||
|
if(key == '2'){
|
||||||
|
mode = 2;
|
||||||
|
}
|
||||||
|
if(key == '3'){
|
||||||
|
mode = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// clear all the points
|
// clear all the points
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define OFX_PROFILER 1
|
|
||||||
|
|
||||||
#include "ofMain.h"
|
#include "ofMain.h"
|
||||||
#include "ofxProfiler.h"
|
#include "ofxProfiler.h"
|
||||||
|
|
||||||
|
|
|
@ -148,7 +148,6 @@ class InstrumentationTimer {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OFX_PROFILER 1
|
|
||||||
// Resolve which function signature macro will HZ_PROFILE_BEGIN_SESSIONbe used. Note that this only
|
// Resolve which function signature macro will HZ_PROFILE_BEGIN_SESSIONbe used. Note that this only
|
||||||
// is resolved when the (pre)compiler starts, so the syntax highlighting
|
// is resolved when the (pre)compiler starts, so the syntax highlighting
|
||||||
// could mark the wrong one in your editor!
|
// could mark the wrong one in your editor!
|
||||||
|
|
Loading…
Reference in a new issue