medfall

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

commit 25708262df01768c75c99a1afa6e19ca8676de9f
parent 10f61c382444d138696cf6fa7de3005182593dc6
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Nov 27 13:51:19 +0200

Little consistency

Diffstat:
renderer.cc | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/renderer.cc b/renderer.cc @@ -12,6 +12,7 @@ STATIC_ASSERT( sizeof( VAO ) == sizeof( GLuint ) ); STATIC_ASSERT( sizeof( Shader ) == sizeof( GLuint ) ); STATIC_ASSERT( sizeof( Texture ) == sizeof( GLuint ) ); STATIC_ASSERT( sizeof( TextureBuffer ) == sizeof( GLuint ) ); +STATIC_ASSERT( sizeof( u32 ) == sizeof( GL_UNSIGNED_INT ) ); // for indexed rendering static const GLuint ATTR_POSITION = 0; static const GLuint ATTR_NORMAL = 1; @@ -405,7 +406,7 @@ void renderer_draw_mesh( const Mesh & mesh, RenderState state ) { glUseProgram( state.shader ); glBindVertexArray( mesh.vao ); - for( size_t i = 0; i < ARRAY_COUNT( state.ubs ); i++ ) { + for( size_t i = 0; i < RENDERER_MAX_UBS; i++ ) { glBindBufferBase( GL_UNIFORM_BUFFER, checked_cast< GLuint >( i ), state.ubs[ i ] ); } @@ -433,7 +434,6 @@ 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 {