From 7bd507d266044e3052a1bce4b0abe89c8645cb98 Mon Sep 17 00:00:00 2001 From: Dale Kim Date: Fri, 22 Aug 2014 16:00:38 -0500 Subject: [PATCH] Disable client state in OpenGL example after rendering. Using the example code in another application that has other rendering code can cause rendering bugs or memory access errors if client state is not disabled. --- examples/opengl_example/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/opengl_example/main.cpp b/examples/opengl_example/main.cpp index d2c76fa8..7fe45c1a 100644 --- a/examples/opengl_example/main.cpp +++ b/examples/opengl_example/main.cpp @@ -61,6 +61,9 @@ static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_c } } glDisable(GL_SCISSOR_TEST); + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); } static const char* ImImpl_GetClipboardTextFn()