fixed openGL issues

This commit is contained in:
k-a-z-u
2018-04-04 11:00:57 +02:00
parent 479f58e7e3
commit d578a60a0c
3 changed files with 19 additions and 4 deletions

View File

@@ -51,6 +51,7 @@ Shader::Shader() {
void Shader::setModelMatrix(const QMatrix4x4& m) {
//vao.bind();;
setUniformValue(getUniform("M"), m);
}
@@ -78,6 +79,7 @@ int Shader::getUniform(const char* name) {
return loc;
}
int Shader::getAttribute(const char* name) {
vao.bind();
int loc = attributeLocation(name);
if (loc == -1) {throw std::runtime_error("error");}
return loc;