medfall

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

commit 4fdbc0720b8a7222d4064e97ba38ce5ce0d11263
parent fb07cb5c7c82eff2061d1a650e9b0ded7fd93044
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Wed Aug 19 19:41:46 +0200

Apparently we do need a VAO for the immediate renderer

Diffstat:
immediate.cc | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/immediate.cc b/immediate.cc @@ -26,6 +26,11 @@ void immediate_triangle( ImmediateContext * const ctx, } void immediate_render( ImmediateContext * const ctx, const GLuint at_position, const GLuint at_colour ) { + GLuint vao; + glGenVertexArrays( 1, &vao ); + + glBindVertexArray( vao ); + GLuint vbos[ 2 ]; glGenBuffers( 2, vbos ); @@ -41,8 +46,11 @@ void immediate_render( ImmediateContext * const ctx, const GLuint at_position, c glDrawArrays( GL_TRIANGLES, 0, ctx->num_triangles * 3 ); + glBindVertexArray( 0 ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); + glDeleteBuffers( 2, vbos ); + glDeleteVertexArrays( 1, &vao ); } void immediate_clear( ImmediateContext * const ctx ) {