diff --git a/src/nanovg_gl.h b/src/nanovg_gl.h index 798b2369..7eade902 100644 --- a/src/nanovg_gl.h +++ b/src/nanovg_gl.h @@ -1182,7 +1182,8 @@ static void glnvg__renderFlush(void* uptr) int i; if (gl->ncalls > 0) { - + GLuint lastProgram = 0; + glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*)&lastProgram); // Setup require GL state. glUseProgram(gl->shader.prog); @@ -1255,7 +1256,7 @@ static void glnvg__renderFlush(void* uptr) #endif glDisable(GL_CULL_FACE); glBindBuffer(GL_ARRAY_BUFFER, 0); - glUseProgram(0); + glUseProgram(lastProgram); glnvg__bindTexture(gl, 0); }