From Aurelien Albert, added passing on of the gl array normalize to OpenGL when uses vertex attribute aliasing.

This commit is contained in:
Robert Osfield
2013-06-27 15:18:38 +00:00
parent 90ceb88c12
commit 57947ea75c
4 changed files with 44 additions and 39 deletions

View File

@@ -278,7 +278,7 @@ void GLBeginEndAdapter::End()
{
if (_vertexAttribAssignedList[unit] && _vertexAttribsList[unit].valid())
{
_state->setVertexAttribPointer(unit, _vertexAttribsList[unit].get(), false);
_state->setVertexAttribPointer(unit, _vertexAttribsList[unit].get());
}
}

View File

@@ -757,7 +757,7 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const
const Array* array = _vertexAttribList[index].get();
if(array && array->getBinding()==osg::Array::BIND_PER_VERTEX)
{
state.setVertexAttribPointer( index, array, _vertexAttribList[index]->getNormalize() );
state.setVertexAttribPointer( index, array );
}
}
}
@@ -1145,7 +1145,7 @@ void Geometry::setVertexAttribNormalize(unsigned int index,GLboolean norm)
{
if (index<_vertexAttribList.size() && _vertexAttribList[index].valid())
{
_vertexAttribList[index]->setNormalize(norm);
_vertexAttribList[index]->setNormalize(norm!=GL_FALSE);
dirtyDisplayList();
}
@@ -1822,7 +1822,7 @@ void deprecated_osg::Geometry::setVertexAttribNormalize(unsigned int index,GLboo
{
if (index<_vertexAttribList.size() && _vertexAttribList[index].valid())
{
_vertexAttribList[index]->setNormalize(norm);
_vertexAttribList[index]->setNormalize(norm!=GL_FALSE);
dirtyDisplayList();
}

View File

@@ -981,12 +981,12 @@ bool State::setClientActiveTextureUnit( unsigned int unit )
return true;
}
void State::setFogCoordPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
void State::setFogCoordPointer(GLenum type, GLsizei stride, const GLvoid *ptr, GLboolean normalized)
{
#ifdef OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE
if (_useVertexAttributeAliasing)
{
setVertexAttribPointer(_fogCoordAlias._location, 1, type, GL_FALSE, stride, ptr);
setVertexAttribPointer(_fogCoordAlias._location, 1, type, normalized, stride, ptr);
}
else
{
@@ -1008,17 +1008,17 @@ void State::setFogCoordPointer(GLenum type, GLsizei stride, const GLvoid *ptr)
}
}
#else
setVertexAttribPointer(_fogCoordAlias._location, 1, type, GL_FALSE, stride, ptr);
setVertexAttribPointer(_fogCoordAlias._location, 1, type, normalized, stride, ptr);
#endif
}
void State::setSecondaryColorPointer( GLint size, GLenum type,
GLsizei stride, const GLvoid *ptr )
GLsizei stride, const GLvoid *ptr, GLboolean normalized )
{
#ifdef OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE
if (_useVertexAttributeAliasing)
{
setVertexAttribPointer(_secondaryColorAlias._location, size, type, GL_FALSE, stride, ptr);
setVertexAttribPointer(_secondaryColorAlias._location, size, type, normalized, stride, ptr);
}
else
{
@@ -1036,10 +1036,11 @@ void State::setSecondaryColorPointer( GLint size, GLenum type,
}
_secondaryColorArray._lazy_disable = false;
_secondaryColorArray._dirty = false;
_secondaryColorArray._normalized = normalized;
}
}
#else
setVertexAttribPointer(_secondaryColorAlias._location, size, type, GL_FALSE, stride, ptr);
setVertexAttribPointer(_secondaryColorAlias._location, size, type, normalized, stride, ptr);
#endif
}