commit 39a2bdc8269f6b402a53299c97eac6393895fac5 parent f2586c97bb14c83f4ad927680ff14d9a2be24474 Author: Michael Savage <mikejsavage@gmail.com> Date: Sat Oct 29 18:46:55 +0300 Fix renderer_draw_mesh, minor efficiency tweaks Diffstat:
renderer.cc | | | 2 | +- |
renderer.h | | | 6 | +++--- |
diff --git a/renderer.cc b/renderer.cc @@ -252,7 +252,7 @@ static GLenum primitivetype_to_glenum( PrimitiveType primitive_type ) { } } -void renderer_draw_mesh( Mesh mesh, RenderState state ) { +void renderer_draw_mesh( const Mesh & mesh, RenderState state ) { // TODO: check vs OpenGLState if these binds are really necessary glUseProgram( state.shader ); glBindVertexArray( mesh.vao ); diff --git a/renderer.h b/renderer.h @@ -59,8 +59,8 @@ enum PrimitiveType { }; struct Mesh { - VAO vao; size_t num_vertices; + VAO vao; PrimitiveType primitive_type; bool indexed; }; @@ -126,7 +126,7 @@ Shader renderer_new_shader( const char * vertex_src, const char * fragment_src ) void renderer_delete_shader(); Mesh renderer_new_mesh( MeshConfig config ); -void renderer_draw_mesh( Mesh mesh, RenderState state ); -void renderer_delete_mesh( Mesh mesh ); +void renderer_draw_mesh( const Mesh & mesh, RenderState state ); +void renderer_delete_mesh( const Mesh & mesh ); #endif // _RENDERER_H_