Skip to content

Commit

Permalink
Examples: OpenGL3: More explicit testing for == GL_UPPER_LEFT in case…
Browse files Browse the repository at this point in the history
… glGetIntegerv(GL_CLIP_ORIGIN is not honored properly. (#2186, #2195) Fix f52f0a5
  • Loading branch information
ocornut committed Nov 21, 2018
1 parent cc4b1f9 commit be66f94
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/imgui_impl_opengl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit be66f94

Please sign in to comment.