My Problem:
When trying to perform frame buffer operations in a separate class outside of the main one handling my rendering loop, the code executes and some functions register, but ultimately the result of the operations doesn't render.
To be absolutely clear, if I copy my intended rendering operations out of a separate class (GBuffer) and merge it into my main rendering class, everything works.
If that happens to be the wrong question, an alternative question would be "how do I perform rendering operations outside of the QOpenGLWidget class?"
Details:
In my rendering loop, I can perform the following and render a scene to my screen:
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, TARGET_FBO);
glDrawBuffer(GL_COLOR_ATTACHMENT4);
glClear(GL_COLOR_BUFFER_BIT);
RenderPass();
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_READ_FRAMEBUFFER, TARGET_FBO);
glReadBuffer(GL_COLOR_ATTACHMENT4);
glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
However, if I move the lines before and after the render pass into a separate class, such as a GBuffer, the code will run, but nothing will render:
GBuffer.StartFrame();
RenderPass();
GBuffer.FinalPass();
glBlitFramebuffer(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
My rendering class extends a class of mine Called DFuncShader, which holds a shader program and extends QOpenGLFunctions_4_3_Core. I've been doing this for several other classes and haven't noticed any problems, however none of them did anything with frame buffers before, they all mainly just handled shader operations.
The only differences is that my Rendering class inherits from the QOpenGLWidget as well.
The only solution I can think of is to add a pointer in my GBuffer class towards my main rendering class, and append all OpenGL calls with that pointer, pretty much making the class moot...