VBO uses ShaderManager to get current bound shader
This commit is contained in:
parent
753df55973
commit
910ba17444
1 changed files with 4 additions and 9 deletions
|
@ -1547,17 +1547,12 @@ void GLVertexBufferPrivate::corePainting( const QRegion& region, GLenum primitiv
|
||||||
glEnableVertexAttribArray( 1 );
|
glEnableVertexAttribArray( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: have this information available somewhere useable
|
GLShader *shader = ShaderManager::instance()->getBoundShader();
|
||||||
GLint currentProgram;
|
GLint vertexAttrib = shader->attributeLocation("vertex");
|
||||||
glGetIntegerv( GL_CURRENT_PROGRAM, ¤tProgram );
|
GLint texAttrib = shader->attributeLocation("texCoord" );
|
||||||
GLint vertexAttrib = glGetAttribLocation( currentProgram, "vertex" );
|
|
||||||
GLint texAttrib = glGetAttribLocation( currentProgram, "texCoord" );
|
|
||||||
|
|
||||||
if (useColor) {
|
if (useColor) {
|
||||||
GLint colorLocation = glGetUniformLocation(currentProgram, "geometryColor");
|
shader->setUniform("geometryColor", color);
|
||||||
if (colorLocation != 0) {
|
|
||||||
glUniform4f(colorLocation, color.redF(), color.greenF(), color.blueF(), color.alphaF());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glBindBuffer( GL_ARRAY_BUFFER, buffers[ 0 ] );
|
glBindBuffer( GL_ARRAY_BUFFER, buffers[ 0 ] );
|
||||||
|
|
Loading…
Reference in a new issue