medfall

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

commit 6c1edccefd47e715a8367bd6f26f52f0768ea122
parent af00f285c86ce4472719b44a9879ab307613b2f8
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Dec  4 15:55:10 +0200

Add renderer_delete_shader

Diffstat:
renderer.cc | 4++++
renderer.h | 1+
skybox.cc | 2+-
text_renderer.cc | 2+-
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/renderer.cc b/renderer.cc @@ -281,6 +281,10 @@ Shader renderer_new_shader( const char * vertex_src, const char * fragment_src ) return renderer_new_shader( config ); } +void renderer_delete_shader( Shader shader ) { + glDeleteProgram( shader ); +} + Texture renderer_new_texture( TextureConfig config ) { GLuint texture; glGenTextures( 1, &texture ); diff --git a/renderer.h b/renderer.h @@ -159,6 +159,7 @@ void renderer_tb_data( TB tb, const void * data, size_t len, BufferUsage usage = Shader renderer_new_shader( ShaderConfig config ); Shader renderer_new_shader( const char * vertex_src, const char * fragment_src ); +void renderer_delete_shader( Shader shader ); Texture renderer_new_texture( TextureConfig config ); void renderer_delete_texture( Texture texture ); diff --git a/skybox.cc b/skybox.cc @@ -105,7 +105,7 @@ void skybox_render( const Skybox * skybox, v3 view_angles, float sun ) { void skybox_destroy( Skybox * skybox ) { renderer_delete_mesh( skybox->mesh ); - // renderer_delete_shader( skybox->shader ); + renderer_delete_shader( skybox->shader ); renderer_delete_ub( skybox->vertex_uniforms ); renderer_delete_ub( skybox->fragment_uniforms ); } diff --git a/text_renderer.cc b/text_renderer.cc @@ -160,7 +160,7 @@ void draw_text( const char * str, float x, float y, float pixel_size ) { void text_renderer_term() { free( ttf ); - // renderer_delete_shader( shader ); + renderer_delete_shader( shader ); for( size_t i = 0; i < num_sizes; i++ ) { renderer_delete_texture( sizes[ i ].atlas ); }