Skip to content

Commit

Permalink
Automatically include the available gl loader header
Browse files Browse the repository at this point in the history
  • Loading branch information
osheriff authored and ocornut committed Sep 22, 2019
1 parent 80b3ab7 commit 44cd8e3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion examples/imgui_impl_opengl3.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLEW) \
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLAD) \
&& !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
#define IMGUI_IMPL_OPENGL_LOADER_GL3W
// to avoid problem with non-clang compilers not having this macro.
#if defined(__has_include)
// check if the header exists, then automatically define the macros ..
#if __has_include(<GL/glew.h>)
#define IMGUI_IMPL_OPENGL_LOADER_GLEW
#elif __has_include(<glad/glad.h>)
#define IMGUI_IMPL_OPENGL_LOADER_GLAD
#else
#define IMGUI_IMPL_OPENGL_LOADER_GL3W
#endif
#else
#define IMGUI_IMPL_OPENGL_LOADER_GL3W
#endif
#endif

IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
Expand Down

0 comments on commit 44cd8e3

Please sign in to comment.