Last active
August 29, 2015 14:12
-
-
Save tgfrerer/b87b7427e0b1a4f0783c to your computer and use it in GitHub Desktop.
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{ | |
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