summaryrefslogtreecommitdiff
path: root/src/render/Shader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/Shader.cpp')
-rw-r--r--src/render/Shader.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/render/Shader.cpp b/src/render/Shader.cpp
index e69de29b..96b3caf7 100644
--- a/src/render/Shader.cpp
+++ b/src/render/Shader.cpp
@@ -0,0 +1,13 @@
+#include "Shader.hpp"
+
+GLint CShader::getUniformLocation(const std::string& unif) {
+ const auto itpos = m_muUniforms.find(unif);
+
+ if (itpos == m_muUniforms.end()) {
+ const auto unifLoc = glGetUniformLocation(program, unif.c_str());
+ m_muUniforms[unif] = unifLoc;
+ return unifLoc;
+ }
+
+ return itpos->second;
+} \ No newline at end of file