Created
October 2, 2014 16:08
-
-
Save tgfrerer/bce463cfa2213b7bf23f to your computer and use it in GitHub Desktop.
opengl optimisations testcase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofMain.h" | |
class ofApp : public ofBaseApp{ | |
ofVboMesh mMshSphere; | |
ofCamera mCam1; | |
public: | |
void setup(){ | |
ofSetFrameRate(0); | |
ofSetVerticalSync(true); | |
mCam1.setupPerspective(false, 60, 0.5, 2000); | |
mCam1.setPosition(0,0, 600); | |
mCam1.lookAt(ofVec3f(0),ofVec3f(0,1,0)); | |
mMshSphere = ofSpherePrimitive(300,12).getMesh(); | |
}; | |
void draw(){ | |
ofBackground(ofColor::black); | |
mCam1.begin(); | |
ofRotate(ofGetFrameNum() % 360, 0, 1, 0); | |
for (int i =0; i< 360; i+=5){ | |
ofPushMatrix(); | |
ofRotate( i, 1, 0, 0); | |
ofSetColor(ofColor::white); | |
mMshSphere.drawWireframe(); | |
ofPopMatrix(); | |
} | |
mCam1.end(); | |
}; | |
}; | |
//======================================================================== | |
int main( ){ | |
ofSetOpenGLVersion(4,1); | |
ofSetupOpenGL(1024,768,OF_WINDOW); // <-------- setup the GL context | |
// this kicks off the running of my app | |
// can be OF_WINDOW or OF_FULLSCREEN | |
// pass in width and height too: | |
ofRunApp(new ofApp()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment