VBO uses ShaderManager to get current bound shader

This commit is contained in:
Martin Gräßlin 2010-12-11 11:10:53 +01:00
parent 753df55973
commit 910ba17444

View file

@ -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, &currentProgram ); 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 ] );