Pre-generated OpenGL/EGL loaders built with glad 0.1.36. Use this when you want a ready-to-build C/CMake package (no generator step) that you can drop into other projects via find_package(glad CONFIG REQUIRED).
Clone: git clone git@github.com:vertexnova/opengl-glad.git
- OpenGL 4.6 compatibility profile loader
- Optional loaders: OpenGL ES 3, EGL 1.5, GLX 1.4, WGL
- Single library target:
glad::glad - No runtime dependencies beyond your platform OpenGL/EGL implementation
cmake -S . -B build \
-DGLAD_ENABLE_GL=ON \
-DGLAD_ENABLE_GLES3=OFF \
-DGLAD_ENABLE_EGL=ON \
-DGLAD_ENABLE_GLX=ON \
-DGLAD_ENABLE_WGL=ON \
-DGLAD_BUILD_SHARED=OFF
cmake --build build
cmake --install build --prefix <install-prefix>Quick static + OpenGL-only on macOS:
cmake -S . -B build -DGLAD_ENABLE_GL=ON -DGLAD_ENABLE_EGL=OFF -DGLAD_ENABLE_GLX=OFF -DGLAD_ENABLE_WGL=OFF
cmake --build buildGLAD_ENABLE_GL(ON) — build the OpenGL loaderGLAD_ENABLE_GLES3(OFF) — build the OpenGL ES 3 loaderGLAD_ENABLE_EGL(default ON on non-Apple) — build the EGL loaderGLAD_ENABLE_GLX(default ON on non-Apple) — build the GLX loaderGLAD_ENABLE_WGL(default ON on Windows) — build the WGL loaderGLAD_BUILD_SHARED(OFF) — build a shared library instead of staticGLAD_INSTALL(ON) — generate install/export targets
find_package(glad CONFIG REQUIRED)
add_executable(app main.cpp)
target_link_libraries(app PRIVATE glad::glad)Headers to include and loader calls:
- OpenGL:
#include <glad/glad.h>and callgladLoadGLLoader(...)(orgladLoadGL()if you provide the loader globally) - OpenGL ES 3:
#include <glad/glad_es3.h>and callgladLoadGLES2Loader(...) - EGL:
#include <glad/glad_egl.h>and callgladLoadEGL()orgladLoadEGLLoader(...) - GLX:
#include <glad/glad_glx.h>and callgladLoadGLX(display, screen)orgladLoadGLXLoader(loader, display, screen) - WGL:
#include <glad/glad_wgl.h>and callgladLoadWGL(hdc)orgladLoadWGLLoader(loader, hdc)
These headers/sources were produced with https://glad.dav1d.de using:
- API: OpenGL 4.6 (compatibility), OpenGL ES 3, EGL 1.5
- Extensions: none (core only)
- Options: Generate loader, Local files, khrplatform on
- Backends: GLX 1.4, WGL, EGL
If you regenerate, replace the files under include/glad/ and src/ and rebuild.
Apache-2.0. See headers for details.