70 for ( GLuint i = 0; i < 8; ++i )
72 glDisableVertexAttribArray ( i );
76 for (
auto& attribute : mMesh->GetAttributes() )
78 auto it = std::lower_bound ( aAttributes.begin(), aAttributes.end(), std::get<0> ( attribute ),
83 if ( it == aAttributes.end() || it->name != std::get<0> ( attribute ) )
91 glEnableVertexAttribArray ( it->location );
92 OPENGL_CHECK_ERROR_THROW;
95 glVertexAttribPointer (
97 std::get<1> ( attribute ),
98 MeshTypeToOGL[std::get<2> ( attribute )],
100 static_cast<GLsizei
> ( mMesh->GetStride() ),
101 reinterpret_cast<const void*
> ( offset ) );
102 OPENGL_CHECK_ERROR_THROW;
106 glVertexAttribIPointer (
108 std::get<1> ( attribute ),
109 MeshTypeToOGL[std::get<2> ( attribute )],
110 static_cast<GLsizei
> ( mMesh->GetStride() ),
111 reinterpret_cast<const void*
> ( offset ) );
116 if ( mIndexBuffer.GetSize() != 0 )
118 glBindBuffer ( GL_ELEMENT_ARRAY_BUFFER, mIndexBuffer.GetBufferId() );
122 glBindBuffer ( GL_ELEMENT_ARRAY_BUFFER, 0 );
124 OPENGL_CHECK_ERROR_THROW;