Created
May 18, 2016 09:29
-
-
Save mruegenberg/510f607560285b781808acb42f9cc56d to your computer and use it in GitHub Desktop.
Problem with oF multiwindow and textures
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
// in GuiApp.h: | |
// ofFbo fbo2; | |
void GuiApp::setup(){ | |
parameters.setName("parameters"); | |
parameters.add(radius.set("radius",50,1,100)); | |
parameters.add(color.set("color",100,ofColor(0,0),255)); | |
gui.setup(parameters); | |
ofBackground(0); | |
ofSetVerticalSync(false); | |
fbo2.allocate(100,100); | |
} | |
void GuiApp::update(){ | |
fbo2.begin(); | |
ofClear(0); | |
ofFill(); | |
ofSetColor(255,0,0); | |
ofDrawRectangle(0,0,100,100); | |
fbo2.end(); | |
} | |
void GuiApp::draw(){ | |
gui.draw(); | |
fbo.draw(0,0); | |
} |
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
// in ofApp.h: | |
// ofFbo fbo; | |
void ofApp::setup(){ | |
ofBackground(255); | |
ofSetCircleResolution(200); | |
fbo.allocate(100,100); | |
} | |
//-------------------------------------------------------------- | |
void ofApp::update(){ | |
fbo.begin(); | |
ofClear(0); | |
ofFill(); | |
ofSetColor(255,0,0); | |
ofDrawRectangle(0,0,100,100); | |
fbo.end(); | |
ofSetColor(255); | |
} | |
//-------------------------------------------------------------- | |
void ofApp::draw(){ | |
ofSetColor(gui->color); | |
ofDrawCircle(ofGetWidth()*0.5,ofGetWidth()*0.5,gui->radius); | |
ofSetColor(0); | |
ofDrawBitmapString(ofGetFrameRate(),20,20); | |
fbo.draw(0,0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment