From 8aff62f5ea7440d40f8ddb00808a6da3772260ce Mon Sep 17 00:00:00 2001 From: Ilya Glushchenko Date: Fri, 25 Oct 2019 11:46:03 +0300 Subject: [PATCH] Support for Glbinding loader library in OpenGL3 example. --- examples/example_sdl_opengl3/main.cpp | 3 +++ examples/imgui_impl_opengl3.cpp | 3 +++ examples/imgui_impl_opengl3.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/examples/example_sdl_opengl3/main.cpp b/examples/example_sdl_opengl3/main.cpp index 03cd3a7bdd90..ca82e824965c 100644 --- a/examples/example_sdl_opengl3/main.cpp +++ b/examples/example_sdl_opengl3/main.cpp @@ -19,6 +19,9 @@ #include // Initialize with glewInit() #elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD) #include // Initialize with gladLoadGL() +#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING) +#include // glbinding::Binding::initialize(); +using namespace gl; #else #include IMGUI_IMPL_OPENGL_LOADER_CUSTOM #endif diff --git a/examples/imgui_impl_opengl3.cpp b/examples/imgui_impl_opengl3.cpp index 3824647aebb9..333ee8d2701e 100644 --- a/examples/imgui_impl_opengl3.cpp +++ b/examples/imgui_impl_opengl3.cpp @@ -114,6 +114,9 @@ #include // Needs to be initialized with glewInit() in user's code #elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD) #include // Needs to be initialized with gladLoadGL() in user's code +#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING) +#include // Needs to be initialized with gladLoadGL() in user's code +using namespace gl; // Has to be set to expose OpenGL to the global namespace #else #include IMGUI_IMPL_OPENGL_LOADER_CUSTOM #endif diff --git a/examples/imgui_impl_opengl3.h b/examples/imgui_impl_opengl3.h index 2d10ea30263b..7289c2dde039 100644 --- a/examples/imgui_impl_opengl3.h +++ b/examples/imgui_impl_opengl3.h @@ -54,6 +54,8 @@ IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(); #define IMGUI_IMPL_OPENGL_LOADER_GLAD #elif __has_include() #define IMGUI_IMPL_OPENGL_LOADER_GL3W + #elif __has_include() + #define IMGUI_IMPL_OPENGL_LOADER_GLBINDING #else #error "Cannot detect OpenGL loader!" #endif