Hyprland/src/render/Shader.cpp

20 lines
453 B
C++
Raw Normal View History

#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;
2022-08-11 20:33:35 +02:00
}
CShader::~CShader() {
// destroy shader
if (program != 0) {
glDeleteProgram(program);
}
}