From 413195cffce55708522810ef811dfee1050794dc Mon Sep 17 00:00:00 2001 From: Andrey Vostrikov Date: Wed, 13 Oct 2021 17:05:40 +0300 Subject: [PATCH 1/2] Include custom OpenGL loader header from define. In case of Windows and custom loader file, no OpenGL API is visible to OpenGL3 implementation. It is needed to include loader header that provides it. Can be provided via CMake for example: target_compile_definitions(target PRIVATE IMGUI_IMPL_OPENGL_LOADER_CUSTOM="custom_opengl3_loader.h") Signed-off-by: Andrey Vostrikov --- backends/imgui_impl_opengl3.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 backends/imgui_impl_opengl3.cpp diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp old mode 100644 new mode 100755 index 58664ea12d07..9f91565fdb3d --- a/backends/imgui_impl_opengl3.cpp +++ b/backends/imgui_impl_opengl3.cpp @@ -113,7 +113,9 @@ #else #include // Use GL ES 3 #endif -#elif !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM) +#elif defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM) +#include IMGUI_IMPL_OPENGL_LOADER_CUSTOM +#else // Modern desktop OpenGL doesn't have a standard portable header file to load OpenGL function pointers. // Helper libraries are often used for this purpose! Here we are using our own minimal custom loader based on gl3w. // In the rest of your app/engine, you can use another loader of your choice (gl3w, glew, glad, glbinding, glext, glLoadGen, etc.). From fda862249e0250a67f01b2d70854003c4732ed49 Mon Sep 17 00:00:00 2001 From: Andrey Vostrikov Date: Wed, 13 Oct 2021 21:48:45 +0300 Subject: [PATCH 2/2] Add extra configuration variable for custom OpenGL loader header Signed-off-by: Andrey Vostrikov --- backends/imgui_impl_opengl3.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backends/imgui_impl_opengl3.cpp b/backends/imgui_impl_opengl3.cpp index 9f91565fdb3d..2683d2c1851a 100755 --- a/backends/imgui_impl_opengl3.cpp +++ b/backends/imgui_impl_opengl3.cpp @@ -114,7 +114,9 @@ #include // Use GL ES 3 #endif #elif defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM) -#include IMGUI_IMPL_OPENGL_LOADER_CUSTOM +#if defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM_INCLUDE) +#include IMGUI_IMPL_OPENGL_LOADER_CUSTOM_INCLUDE +#endif #else // Modern desktop OpenGL doesn't have a standard portable header file to load OpenGL function pointers. // Helper libraries are often used for this purpose! Here we are using our own minimal custom loader based on gl3w.