Skip to content

Instantly share code, notes, and snippets.

@tgfrerer
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgfrerer/8e62e97d4c7f37cc6c89 to your computer and use it in GitHub Desktop.
Save tgfrerer/8e62e97d4c7f37cc6c89 to your computer and use it in GitHub Desktop.
test case : programmable GL renderer does not transform "vanilla" meshes.
#include "ofMain.h"
class ofApp : public ofBaseApp{
ofEasyCam mCam1;
ofVboMesh mMshBackground;
public:
void setup(){
mMshBackground = ofIcoSpherePrimitive(50, 3).getMesh();
mCam1.setupPerspective(false, 60, 10, 10000);
};
void draw(){
ofBackground(ofColor::black);
mCam1.begin();
ofPushMatrix();
ofSetColor(ofColor::green);
mMshBackground.draw();
ofSetColor(ofColor::red);
ofDrawSphere(0, 0, 50);
ofPopMatrix();
mCam1.end();
};
};
//========================================================================
int main( ){
ofSetOpenGLVersion(4, 1);
ofSetupOpenGL(400,300,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