#pragma once #if !defined(TD_IMPL_OPENGL_ES2) \ && !defined(TD_IMPL_OPENGL_ES3) \ && !defined(TD_IMPL_OPENGL_LOADER_GL3W) \ && !defined(TD_IMPL_OPENGL_LOADER_GLEW) \ && !defined(TD_IMPL_OPENGL_LOADER_GLAD) \ && !defined(TD_IMPL_OPENGL_LOADER_GLBINDING2) \ && !defined(TD_IMPL_OPENGL_LOADER_GLBINDING3) \ && !defined(TD_IMPL_OPENGL_LOADER_CUSTOM) \ && !defined(__ANDROID__) #if defined(__has_include) #if __has_include() #define TD_IMPL_OPENGL_LOADER_GLEW #elif __has_include() #define TD_IMPL_OPENGL_LOADER_GLAD #elif __has_include() #define TD_IMPL_OPENGL_LOADER_GL3W #elif __has_include() #define TD_IMPL_OPENGL_LOADER_GLBINDING3 #elif __has_include() #define TD_IMPL_OPENGL_LOADER_GLBINDING2 #else #error "Cannot detect OpenGL loader!" #endif #else #error "Cannot detect loader with include detection !" #endif #endif // Include correct files #if defined(__ANDROID__) #include #elif defined(TD_IMPL_OPENGL_LOADER_GL3W) #include // Needs to be initialized with gl3wInit() in user's code #elif defined(TD_IMPL_OPENGL_LOADER_GLEW) #include // Needs to be initialized with glewInit() in user's code. #elif defined(TD_IMPL_OPENGL_LOADER_GLAD) #include // Needs to be initialized with gladLoadGL() in user's code. #elif defined(TD_IMPL_OPENGL_LOADER_GLBINDING2) #ifndef GLFW_INCLUDE_NONE #define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors. #endif #include // Needs to be initialized with glbinding::Binding::initialize() in user's code. #include using namespace gl; #elif defined(TD_IMPL_OPENGL_LOADER_GLBINDING3) #ifndef GLFW_INCLUDE_NONE #define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors. #endif #include // Needs to be initialized with glbinding::initialize() in user's code. #include using namespace gl; #else #include TD_IMPL_OPENGL_LOADER_CUSTOM #endif