From 697bfd824d956b94b3fcbfb9c83151f309be8899 Mon Sep 17 00:00:00 2001 From: Philipp Rockel Date: Tue, 26 Aug 2014 17:06:12 -0400 Subject: [PATCH] Restore openGL state / unbind buffer These changes make it possible to integrate nanoVG into other openGL libraries like Cinder and openFrameworks and be able to draw afterwards. --- src/nanovg_gl.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nanovg_gl.h b/src/nanovg_gl.h index fc28b58..90b5659 100644 --- a/src/nanovg_gl.h +++ b/src/nanovg_gl.h @@ -1070,7 +1070,9 @@ static void glnvg__renderFlush(void* uptr) glDisableVertexAttribArray(1); #if defined NANOVG_GL3 glBindVertexArray(0); -#endif +#endif + glDisable(GL_CULL_FACE); + glBindBuffer(GL_ARRAY_BUFFER, 0); glUseProgram(0); glBindTexture(GL_TEXTURE_2D, 0); }