From bef0a132833346e934599228eec1813008bd45f4 Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 21 May 2018 11:28:30 +0200 Subject: [PATCH] Examples: Comments about GLSL version not being the same as GL context version. (#1828) --- examples/opengl3_example/imgui_impl_glfw_gl3.cpp | 2 +- examples/opengl3_example/imgui_impl_glfw_gl3.h | 4 ++++ examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp | 2 +- examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/opengl3_example/imgui_impl_glfw_gl3.cpp b/examples/opengl3_example/imgui_impl_glfw_gl3.cpp index 0c6ff0c76..94b352cc3 100644 --- a/examples/opengl3_example/imgui_impl_glfw_gl3.cpp +++ b/examples/opengl3_example/imgui_impl_glfw_gl3.cpp @@ -360,7 +360,7 @@ bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks, const g_Window = window; g_Time = 0.0; - // Store GL version string so we can refer to it later in case we recreate shaders. + // Store GLSL version string so we can refer to it later in case we recreate shaders. Note: GLSL version is NOT the same as GL version. Leave this to NULL if unsure. if (glsl_version == NULL) glsl_version = "#version 150"; IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(g_GlslVersion)); diff --git a/examples/opengl3_example/imgui_impl_glfw_gl3.h b/examples/opengl3_example/imgui_impl_glfw_gl3.h index 33b5329db..e30fcd97b 100644 --- a/examples/opengl3_example/imgui_impl_glfw_gl3.h +++ b/examples/opengl3_example/imgui_impl_glfw_gl3.h @@ -11,6 +11,10 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui +// About GLSL version: +// The 'glsl_version' initialization parameter defaults to "#version 150" if NULL. +// Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure! + struct GLFWwindow; IMGUI_API bool ImGui_ImplGlfwGL3_Init(GLFWwindow* window, bool install_callbacks, const char* glsl_version = NULL); diff --git a/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp b/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp index 727914a78..da71258d3 100644 --- a/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp +++ b/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.cpp @@ -358,7 +358,7 @@ void ImGui_ImplSdlGL3_InvalidateDeviceObjects() bool ImGui_ImplSdlGL3_Init(SDL_Window* window, const char* glsl_version) { - // Store GL version string so we can refer to it later in case we recreate shaders. + // Store GLSL version string so we can refer to it later in case we recreate shaders. Note: GLSL version is NOT the same as GL version. Leave this to NULL if unsure. if (glsl_version == NULL) glsl_version = "#version 150"; IM_ASSERT((int)strlen(glsl_version) + 2 < IM_ARRAYSIZE(g_GlslVersion)); diff --git a/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h b/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h index c694a4816..35076ad42 100644 --- a/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h +++ b/examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h @@ -12,6 +12,10 @@ // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. // https://github.com/ocornut/imgui +// About GLSL version: +// The 'glsl_version' initialization parameter defaults to "#version 150" if NULL. +// Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure! + struct SDL_Window; typedef union SDL_Event SDL_Event;