commit 69dd4523afc8d96fc241b726a22667ce83aba225 parent e39b5f635696b37041c0eb7d622c5192913623dc Author: Michael Savage <mikejsavage@gmail.com> Date: Sun Aug 23 12:41:53 +0200 Use offsetof Diffstat:
immediate.cc | | | 2 | +- |
diff --git a/immediate.cc b/immediate.cc @@ -45,7 +45,7 @@ void immediate_render( glBindBuffer( GL_ARRAY_BUFFER, vbos[ 1 ] ); glBufferData( GL_ARRAY_BUFFER, ctx->num_triangles * sizeof( ImmediateTriangle ), ctx->triangles, GL_STATIC_DRAW ); glEnableVertexAttribArray( at_colour ); - glVertexAttribPointer( at_colour, 3, GL_FLOAT, GL_FALSE, sizeof( ImmediateVertex ), ( GLvoid * ) sizeof( glm::vec3 ) ); + glVertexAttribPointer( at_colour, 3, GL_FLOAT, GL_FALSE, sizeof( ImmediateVertex ), ( GLvoid * ) offsetof( ImmediateVertex, colour ) ); glDrawArrays( GL_TRIANGLES, 0, ctx->num_triangles * 3 );