commit 2861c5654ff4e7d9cfeca6033fca3b747217cfa7
parent f846379a81647e92ccd5a6cc12f3a395cb9b0343
Author: Michael Savage <mikejsavage@gmail.com>
Date: Wed, 19 Dec 2018 17:40:02 +0200
renderer_new_mesh asserts
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/renderer.cc b/renderer.cc
@@ -989,6 +989,8 @@ static GLvoid * offset_to_glvoidp( u32 offset ) {
}
Mesh renderer_new_mesh( MeshConfig config ) {
+ ASSERT( config.num_vertices != 0 );
+
switch( config.primitive_type ) {
case PRIMITIVETYPE_TRIANGLES:
ASSERT( config.num_vertices % 3 == 0 );
@@ -1039,6 +1041,7 @@ Mesh renderer_new_mesh( MeshConfig config ) {
}
}
else {
+ ASSERT( config.stride != 0 );
glBindBuffer( GL_ARRAY_BUFFER, config.unified_buffer );
glEnableVertexAttribArray( ATTR_POSITION );