Skip to content

of 0.80 fbo bug! #2809

Closed
yty opened this Issue Feb 12, 2014 · 1 comment

2 participants

@yty
yty commented Feb 12, 2014

I'm using the latest today OF(master)

settings.colorFormats.resize(attachmentPoint + 1); //=> bug.

test bug example.

    ofFbo::Settings s;
    s.width             =1024;
    s.height            = 768;

    vector<GLint> colorFormats;
    colorFormats.resize(8);
    colorFormats.assign(8,GL_LUMINANCE);


    s.colorFormats = colorFormats;
    s.numColorbuffers   = 8;
    s.numSamples        = 0;
    fbo.allocate(s);
    cout<<fbo.getNumTextures()<<endl;  // Is not equal to 8 is equal to 1
@Geistyp
Geistyp commented Feb 14, 2014
// now create all textures and color buffers
if(settings.colorFormats.size() > 0) {
    for(int i=0; i<(int)settings.colorFormats.size(); i++) createAndAttachTexture(settings.colorFormats[i], i);
}

Loop size(settings.colorFormats.size()) changed in createAndAttachTexture().

maybe we should add a buffer to save formats?

if (settings.colorFormats.size() > 0) {
    vector<GLint> colorFormats = settings.colorFormats;
    for (int i = 0; i < (int)colorFormats.size(); i++) createAndAttachTexture(colorFormats[i], i);
}

@arturoc

@arturoc arturoc added a commit that closed this issue Feb 14, 2014
@arturoc arturoc use passed settings in allocation instead of instance's to avoid bugs
also checks on end of allocation that passed settings and current ones
are the same. Closes #2809
caa4398
@arturoc arturoc closed this in caa4398 Feb 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.