Replaced osg::State:set*Pointer() calls with VertexArrayState::set*Array() calls

This commit is contained in:
Robert Osfield
2016-08-16 10:01:38 +01:00
parent 359b136b5e
commit 164981f7a3
2 changed files with 23 additions and 25 deletions

View File

@@ -419,12 +419,19 @@ struct VertexAttribArrayDispatch : public VertexArrayState::ArrayDispatch
inline void callVertexAttribPointer(GLExtensions* ext, const osg::Array* new_array, const GLvoid * ptr)
{
if (new_array->getDataType()==GL_FLOAT)
ext->glVertexAttribPointer(static_cast<GLuint>(unit), new_array->getDataSize(), new_array->getDataType(), new_array->getNormalize(), 0, ptr);
else if (array->getDataType()==GL_DOUBLE)
ext->glVertexAttribLPointer(static_cast<GLuint>(unit), new_array->getDataSize(), new_array->getDataType(), 0, ptr);
if (array->getPreserveDataType())
{
if (new_array->getDataType()==GL_FLOAT)
ext->glVertexAttribPointer(static_cast<GLuint>(unit), new_array->getDataSize(), new_array->getDataType(), new_array->getNormalize(), 0, ptr);
else if (array->getDataType()==GL_DOUBLE)
ext->glVertexAttribLPointer(static_cast<GLuint>(unit), new_array->getDataSize(), new_array->getDataType(), 0, ptr);
else
ext->glVertexAttribIPointer(static_cast<GLuint>(unit), new_array->getDataSize(), new_array->getDataType(), 0, ptr);
}
else
ext->glVertexAttribIPointer(static_cast<GLuint>(unit), new_array->getDataSize(), new_array->getDataType(), 0, ptr);
{
ext->glVertexAttribPointer(static_cast<GLuint>(unit), new_array->getDataSize(), new_array->getDataType(), new_array->getNormalize(), 0, ptr);
}
}
virtual void enable_and_dispatch(osg::State& state, const osg::Array* new_array)