Quantcast
Viewing all articles
Browse latest Browse all 4929

Framebuffer with id: 0 cannot be bound onto itself

@synchromaStudio wrote:

I’m trying to write a class that draws a waveform. Suffice to say I’m drawing rectangles according to the maximum and minimum amplitude of the wave - I have these values stored in two vectors, upWave and dnWave.

Writing into the framebuffer seems to work OK until the end, when I get the error:
Framebuffer with id: 0 cannot be bound onto itself

The code:

fbo.allocate(blocks, trackHeight, GL_RGBA);
trackPix.allocate(blocks, trackHeight, OF_IMAGE_COLOR_ALPHA);

fbo.begin();
ofClear(0,0,0,0);
ofSetColor(255,255,255,255);
for(j = 0; j < blocks; j++)
{
ofDrawRectangle((float)j, trackHeight * 0.5, 0.0f, 1.0f, trackHeight * 0.5 * upWave[j]);
ofDrawRectangle((float)j, trackHeight * 0.5, 0.0f, 1.0f, trackHeight * 0.5 * dnWave[j]);
}
fbo.end();
fbo.readToPixels(trackPix);

The error:

[ error ] ofFbo: UNKNOWN ERROR 0
[warning] Framebuffer with id: 0 cannot be bound onto itself.
Most probably you forgot to end() the current framebuffer before calling begin() again or you forgot to allocate() before calling begin().

Any clues? I don’t get the error until after the last rectangle is drawn. I’ve tried increasing the allocation of the framebuffer to blocks + 1 to no avail.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles