medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 10f61c382444d138696cf6fa7de3005182593dc6
parent 3e3aeca1610771c531f7b3de575e0b248dd9b2a4
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Nov 27 13:50:10 +0200

u32 num_vertices in renderer

Diffstat:
renderer.cc | 1+
renderer.h | 4++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/renderer.cc b/renderer.cc @@ -433,6 +433,7 @@ void renderer_draw_mesh( const Mesh & mesh, RenderState state ) { GLenum primitive = primitivetype_to_glenum( mesh.primitive_type ); if( mesh.indexed ) { + static_assert( sizeof( u32 ) == sizeof( GL_UNSIGNED_INT ) ); glDrawElements( primitive, mesh.num_vertices, GL_UNSIGNED_INT, 0 ); } else { diff --git a/renderer.h b/renderer.h @@ -78,7 +78,7 @@ enum PrimitiveType { }; struct Mesh { - size_t num_vertices; + u32 num_vertices; VAO vao; PrimitiveType primitive_type; bool indexed; @@ -91,7 +91,7 @@ struct MeshConfig { VB tex_coords1; VB colours; IB indices; - size_t num_vertices; + u32 num_vertices; PrimitiveType primitive_type; };