diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-11-13 14:43:20 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-11-14 23:46:14 +0000 |
commit | 5b854f135a4bf38ce993cc567461bf204894fb44 (patch) | |
tree | 23c3a2d7e215923d8fef821ebb9b47438681b8cf /ui/sceneRenderer.cpp | |
parent | Pass flags to Window constructor (diff) | |
download | ilt-5b854f135a4bf38ce993cc567461bf204894fb44.tar.bz2 ilt-5b854f135a4bf38ce993cc567461bf204894fb44.tar.xz ilt-5b854f135a4bf38ce993cc567461bf204894fb44.zip |
Pass the output framebuffer id to scene renderer
Diffstat (limited to 'ui/sceneRenderer.cpp')
-rw-r--r-- | ui/sceneRenderer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/sceneRenderer.cpp b/ui/sceneRenderer.cpp index 5ef0379..9432710 100644 --- a/ui/sceneRenderer.cpp +++ b/ui/sceneRenderer.cpp @@ -10,7 +10,7 @@ static constexpr std::array<glm::vec4, 4> displayVAOdata {{ {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, -1.0f, 1.0f, 0.0f}, }}; -SceneRenderer::SceneRenderer(glm::ivec2 size) : lighting {lightingShader_vs, lightingShader_fs} +SceneRenderer::SceneRenderer(glm::ivec2 size, GLuint o) : output {o}, lighting {lightingShader_vs, lightingShader_fs} { glBindVertexArray(displayVAO); glBindBuffer(GL_ARRAY_BUFFER, displayVBO); @@ -43,7 +43,7 @@ SceneRenderer::SceneRenderer(glm::ivec2 size) : lighting {lightingShader_vs, lig if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { throw std::runtime_error("Framebuffer not complete!"); } - glBindFramebuffer(GL_FRAMEBUFFER, 0); + glBindFramebuffer(GL_FRAMEBUFFER, output); } void @@ -58,7 +58,7 @@ SceneRenderer::render(std::function<void()> content) const glBindFramebuffer(GL_FRAMEBUFFER, gBuffer); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); content(); - glBindFramebuffer(GL_FRAMEBUFFER, 0); + glBindFramebuffer(GL_FRAMEBUFFER, output); // Lighting pass glDisable(GL_BLEND); |