mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-05 09:05:59 +01:00
20 lines
No EOL
448 B
C++
20 lines
No EOL
448 B
C++
#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;
|
|
}
|
|
|
|
CShader::~CShader() {
|
|
// destroy shader
|
|
if (program) {
|
|
glDeleteProgram(program);
|
|
}
|
|
} |