Commit a74dd588 authored by Martin Schultz's avatar Martin Schultz

fixed segfault, when OpenGL Version less than 3.3 is used because

glVertexAttribDivisor is a nullpointer. Use ARB extension call instead
parent 831b973c
......@@ -468,7 +468,14 @@ void VertexDeclaration::activateShaderPipeline(GLSL::Program* _prog) const
if (supportsInstancedArrays())
{
glVertexAttribDivisor(loc, pElem->divisor_);
if( openGLVersion(3,3) )
{
glVertexAttribDivisor(loc, pElem->divisor_);
}
else
{
glVertexAttribDivisorARB(loc, pElem->divisor_);
}
}
else if (pElem->divisor_)
std::cerr << "error: VertexDeclaration::activateShaderPipeline - instanced arrays not supported by gpu!" << std::endl;
......@@ -500,7 +507,14 @@ void VertexDeclaration::deactivateShaderPipeline( GLSL::Program* _prog ) const
if (supportsInstancedArrays() && pElem->divisor_)
{
glVertexAttribDivisor(loc, 0);
if( openGLVersion(3,3) )
{
glVertexAttribDivisor(loc, 0);
}
else
{
glVertexAttribDivisorARB(loc, 0);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment