|
|
@ -13,6 +13,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
// CHANGELOG
|
|
|
|
// CHANGELOG
|
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
|
|
|
|
|
// 2021-04-06: OpenGL: Don't try to read GL_CLIP_ORIGIN unless we're OpenGL 4.5 or greater.
|
|
|
|
// 2021-02-18: OpenGL: Change blending equation to preserve alpha in output buffer.
|
|
|
|
// 2021-02-18: OpenGL: Change blending equation to preserve alpha in output buffer.
|
|
|
|
// 2021-01-03: OpenGL: Backup, setup and restore GL_STENCIL_TEST state.
|
|
|
|
// 2021-01-03: OpenGL: Backup, setup and restore GL_STENCIL_TEST state.
|
|
|
|
// 2020-10-23: OpenGL: Backup, setup and restore GL_PRIMITIVE_RESTART state.
|
|
|
|
// 2020-10-23: OpenGL: Backup, setup and restore GL_PRIMITIVE_RESTART state.
|
|
|
@ -262,11 +263,14 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Support for GL 4.5 rarely used glClipControl(GL_UPPER_LEFT)
|
|
|
|
// Support for GL 4.5 rarely used glClipControl(GL_UPPER_LEFT)
|
|
|
|
#if defined(GL_CLIP_ORIGIN) && !defined(__APPLE__)
|
|
|
|
#if defined(GL_CLIP_ORIGIN)
|
|
|
|
bool clip_origin_lower_left = true;
|
|
|
|
bool clip_origin_lower_left = true;
|
|
|
|
GLenum current_clip_origin = 0; glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)¤t_clip_origin);
|
|
|
|
if (g_GlVersion >= 450)
|
|
|
|
if (current_clip_origin == GL_UPPER_LEFT)
|
|
|
|
{
|
|
|
|
clip_origin_lower_left = false;
|
|
|
|
GLenum current_clip_origin = 0; glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)¤t_clip_origin);
|
|
|
|
|
|
|
|
if (current_clip_origin == GL_UPPER_LEFT)
|
|
|
|
|
|
|
|
clip_origin_lower_left = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Setup viewport, orthographic projection matrix
|
|
|
|
// Setup viewport, orthographic projection matrix
|
|
|
@ -276,7 +280,7 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
|
|
|
|
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
|
|
|
|
float R = draw_data->DisplayPos.x + draw_data->DisplaySize.x;
|
|
|
|
float T = draw_data->DisplayPos.y;
|
|
|
|
float T = draw_data->DisplayPos.y;
|
|
|
|
float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y;
|
|
|
|
float B = draw_data->DisplayPos.y + draw_data->DisplaySize.y;
|
|
|
|
#if defined(GL_CLIP_ORIGIN) && !defined(__APPLE__)
|
|
|
|
#if defined(GL_CLIP_ORIGIN)
|
|
|
|
if (!clip_origin_lower_left) { float tmp = T; T = B; B = tmp; } // Swap top and bottom if origin is upper left
|
|
|
|
if (!clip_origin_lower_left) { float tmp = T; T = B; B = tmp; } // Swap top and bottom if origin is upper left
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
const float ortho_projection[4][4] =
|
|
|
|
const float ortho_projection[4][4] =
|
|
|
|