aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMon ouïe <mon.ouie@gmail.com>2023-12-01 11:13:33 +0100
committerMon ouïe <mon.ouie@gmail.com>2023-12-01 11:13:33 +0100
commit50a87e80bbe705b3d7f872afbc40ec28f677ee89 (patch)
tree93e43492ac7deca497489a514e127ee6cc7362a1 /src
parent1bce20fff5e631640d39346a1bf0dca8ecd3479e (diff)
Store uniform location for overlay rendering code
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index d96b2cd..b9a7b48 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -426,6 +426,7 @@ private: // X compositor
xdo_t *overlay_xdo = nullptr;
Atom overlay_icon_atom;
bool overlay_mouse_controls = true;
+ GLint m_unOverlayTextureLoc;
};
@@ -2050,6 +2051,8 @@ bool CMainApplication::CreateAllShaders()
"}\n"
);
+ m_unOverlayTextureLoc = glGetUniformLocation(m_unOverlayProgramID, "mytexture");
+
return m_unSceneProgramID != 0
&& m_unCompanionWindowProgramID != 0 &&
m_unOverlayProgramID != 0;
@@ -2897,7 +2900,7 @@ void CMainApplication::RenderOverlay() {
glBindTexture(GL_TEXTURE_2D, ref_texture);
glBindVertexArray( m_unCompanionWindowVAO );
glUseProgram(m_unOverlayProgramID);
- glUniform1i(glGetUniformLocation(m_unOverlayProgramID, "mytexture"), 0);
+ glUniform1i(m_unOverlayTextureLoc, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, overlay_buffers->get_renderFramebufferId());