|
|
@ -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)
|
|
|
|
|
|
|
|
// 2020-10-15: OpenGL: Use glGetString(GL_VERSION) instead of glGetIntegerv(GL_MAJOR_VERSION, ...) when the later returns zero (e.g. Desktop GL 2.x)
|
|
|
|
// 2020-09-17: OpenGL: Fix to avoid compiling/calling glBindSampler() on ES or pre 3.3 context which have the defines set by a loader.
|
|
|
|
// 2020-09-17: OpenGL: Fix to avoid compiling/calling glBindSampler() on ES or pre 3.3 context which have the defines set by a loader.
|
|
|
|
// 2020-07-10: OpenGL: Added support for glad2 OpenGL loader.
|
|
|
|
// 2020-07-10: OpenGL: Added support for glad2 OpenGL loader.
|
|
|
|
// 2020-05-08: OpenGL: Made default GLSL version 150 (instead of 130) on OSX.
|
|
|
|
// 2020-05-08: OpenGL: Made default GLSL version 150 (instead of 130) on OSX.
|
|
|
@ -147,9 +148,16 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Query for GL version (e.g. 320 for GL 3.2)
|
|
|
|
// Query for GL version (e.g. 320 for GL 3.2)
|
|
|
|
#if !defined(IMGUI_IMPL_OPENGL_ES2)
|
|
|
|
#if !defined(IMGUI_IMPL_OPENGL_ES2)
|
|
|
|
GLint major, minor;
|
|
|
|
GLint major = 0;
|
|
|
|
|
|
|
|
GLint minor = 0;
|
|
|
|
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
|
|
|
glGetIntegerv(GL_MAJOR_VERSION, &major);
|
|
|
|
glGetIntegerv(GL_MINOR_VERSION, &minor);
|
|
|
|
glGetIntegerv(GL_MINOR_VERSION, &minor);
|
|
|
|
|
|
|
|
if (major == 0 && minor == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Query GL_VERSION in desktop GL 2.x, the string will start with "<major>.<minor>"
|
|
|
|
|
|
|
|
const char* gl_version = (const char*)glGetString(GL_VERSION);
|
|
|
|
|
|
|
|
sscanf(gl_version, "%d.%d", &major, &minor);
|
|
|
|
|
|
|
|
}
|
|
|
|
g_GlVersion = (GLuint)(major * 100 + minor * 10);
|
|
|
|
g_GlVersion = (GLuint)(major * 100 + minor * 10);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
g_GlVersion = 200; // GLES 2
|
|
|
|
g_GlVersion = 200; // GLES 2
|
|
|
|