We are searching data for your request:
Upon completion, a link will appear to access the found materials.
E60032 2 cat code:0x5a : 0x00000000 | 0x00000001
In this case, it doesn't change anything.
You are not calling glFramebufferTexture2D at all, even though that is the function you say you called, the return value you show is a GL_FRAMEBUFFER, which is the same return value that glReadPixels and similar functions return.
Your function is missing the call to glFramebufferTexture2D:
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0),
//glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0),
And here you are calling glFramebufferTexture2D:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, _width, _height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL),
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0),
This problem (framebuffer object corruption) was fixed in OpenGL 4.3 and higher by:
I had a similar problem myself with OpenGL 3.2 and a GeForce 5200 which I could resolve with the solution posted.
The problem seems to be that a framebuffer object was removed from the list of framebuffer objects to be bound when you tried to bind another framebuffer.
You'll need to reset the binding index, then bind agn.
The documentation for glBindFramebuffer() says
GL_READ_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER, and GL_FRAMEBUFFER should always be used with the last argument specifying a context to bind the framebuffer to. If the specified context is NULL, GL_DRAW_FRAMEBUFFER is assumed, and GL_READ_FRAMEBUFFER is assumed if GL_DRAW_FRAMEBUFFER is not specified.
You are creating a framebuffer object, then you bind it with:
// Bind framebuffer 0
then you try to bind framebuffer 2:
// Bind framebuffer 2
You'll need to update framebufferId to reflect the change, then bind it agn.
If you bind a framebuffer multiple times, the last binding is effectively "sticky", and is used until a binding that is at least GL_INVALID_FRAMEBUFFER_OPERATION occurs.
The framebuffer index is just the offset into the framebuffer object array.
If you want to bind the same framebuffer multiple times, just increment the index.