From be66f94639f59a750dfe02fb79da81f5984d6c18 Mon Sep 17 00:00:00 2001 From: omar Date: Wed, 21 Nov 2018 18:24:24 +0100 Subject: [PATCH] Examples: OpenGL3: More explicit testing for == GL_UPPER_LEFT in case glGetIntegerv(GL_CLIP_ORIGIN is not honored properly. (#2186, #2195) Fix f52f0a52771f9609267e9ad67d4f2835e0df0072 --- examples/imgui_impl_opengl3.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/imgui_impl_opengl3.cpp b/examples/imgui_impl_opengl3.cpp index 18b62f86..353d61e9 100644 --- a/examples/imgui_impl_opengl3.cpp +++ b/examples/imgui_impl_opengl3.cpp @@ -165,8 +165,9 @@ void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data) GLboolean last_enable_scissor_test = glIsEnabled(GL_SCISSOR_TEST); bool clip_origin_lower_left = true; #ifdef GL_CLIP_ORIGIN - GLenum last_clip_origin; glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)&last_clip_origin); // Support for GL 4.5's glClipControl(GL_UPPER_LEFT) - clip_origin_lower_left = (last_clip_origin == GL_LOWER_LEFT); + GLenum last_clip_origin = 0; glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)&last_clip_origin); // Support for GL 4.5's glClipControl(GL_UPPER_LEFT) + if (last_clip_origin == GL_UPPER_LEFT) + clip_origin_lower_left = false; #endif // Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, polygon fill