Skip to content

ofFbo: Reallocating FBO with different format doesn't work properly #5559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cuinjune opened this issue Apr 20, 2017 · 2 comments
Open

ofFbo: Reallocating FBO with different format doesn't work properly #5559

cuinjune opened this issue Apr 20, 2017 · 2 comments

Comments

@cuinjune
Copy link
Contributor

Once FBO is allocated with a specific format, the format never changes when it gets reallocated.
@arturoc asked me to post an issue here.

Original forum post :
https://forum.openframeworks.cc/t/reallocating-fbo-with-different-format-doesnt-work-properly

@bakercp
Copy link
Member

bakercp commented May 19, 2017

//--------------------------------------------------------------
void ofApp::setup(){

    fbo.allocate(400, 400, GL_RGB);
    fbo.begin();
    ofClear(ofColor(255,0,0));
    fbo.end();
}

//--------------------------------------------------------------
void ofApp::draw(){
    
    fbo.begin();
    ofSetColor(255, 255, 255);
    ofSetCircleResolution(50);
    ofDrawCircle(200, 200, 200);
    fbo.end();

    fbo.draw(0, 0);
}

//--------------------------------------------------------------
void ofApp::keyPressed(int key){

    fbo.allocate(400, 400, GL_RGBA);
    fbo.begin();
    ofClear(ofColor(0,0,0,0));
    fbo.end();
}

@bakercp bakercp self-assigned this May 19, 2017
@bakercp bakercp added the core label May 21, 2017
@bakercp bakercp added this to the 0.10.0 milestone May 21, 2017
@bakercp
Copy link
Member

bakercp commented May 21, 2017

Just to confirm, doing something like:

ofFbo _fbo;
_fbo.allocate(400, 400, GL_RGBA);
fbo = _fbo;  
fbo.begin();
ofClear(ofColor(0,0,0,0));
fbo.end();

... works correctly.

@bakercp bakercp added the bug label May 22, 2017
@bakercp bakercp changed the title Reallocating FBO with different format doesn't work properly ofFbo: Reallocating FBO with different format doesn't work properly May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants