Trouble reading pixels from a render target

I’m trying to write a program that can create a GIF from an erosion animation; here:

(the build directory has some testing files)

Initially i tried to get the data from the framebuffer with glgetteximage; but this didn’t work in that i just got uninitialized memory. So i changed it to glReadPixels (line 260 of viewwidget.cpp); and now i get an invalid operation error and i don’t know why.

Check the parameters. This should (presumably) be:

glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, buffers[i], 0);
1 Like