Skip to content

Instantly share code, notes, and snippets.

@tgfrerer
Last active August 29, 2015 14:12
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/b87b7427e0b1a4f0783c to your computer and use it in GitHub Desktop.
Save tgfrerer/b87b7427e0b1a4f0783c to your computer and use it in GitHub Desktop.
#include "ofMain.h"
class ofApp : public ofBaseApp{
ofMesh box;
public:
void setup(){
box = ofBoxPrimitive().getMesh();
};
void draw(){
ofBackground(ofColor::gray);
ofSetColor(ofColor::red);
ofDrawRectangle(10, 10, 20, 20);
ofNoFill();
ofDrawRectangle(30, 10, 20, 20);
ofPushStyle();
ofFill();
ofPushMatrix();
ofTranslate(300, 300);
ofScale(2, 2);
box.draw();
ofPopMatrix();
ofPopStyle();
ofDrawRectangle(60, 10, 20, 20);
};
};
//========================================================================
int main( ){
ofGLWindowSettings settings;
if (true){
// use fixed function GL
settings.setGLVersion(2, 1);
} else {
// use GL 4.1
settings.setGLVersion(4, 1);
}
ofCreateWindow(settings);
// 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