Skip to content

vertexnova/opengl-glad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glad (standalone)

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).

Repository

Clone: git clone git@github.com:vertexnova/opengl-glad.git

What is inside

  • 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

Build

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 build

CMake options

  • GLAD_ENABLE_GL (ON) — build the OpenGL loader
  • GLAD_ENABLE_GLES3 (OFF) — build the OpenGL ES 3 loader
  • GLAD_ENABLE_EGL (default ON on non-Apple) — build the EGL loader
  • GLAD_ENABLE_GLX (default ON on non-Apple) — build the GLX loader
  • GLAD_ENABLE_WGL (default ON on Windows) — build the WGL loader
  • GLAD_BUILD_SHARED (OFF) — build a shared library instead of static
  • GLAD_INSTALL (ON) — generate install/export targets

Using in another project

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 call gladLoadGLLoader(...) (or gladLoadGL() if you provide the loader globally)
  • OpenGL ES 3: #include <glad/glad_es3.h> and call gladLoadGLES2Loader(...)
  • EGL: #include <glad/glad_egl.h> and call gladLoadEGL() or gladLoadEGLLoader(...)
  • GLX: #include <glad/glad_glx.h> and call gladLoadGLX(display, screen) or gladLoadGLXLoader(loader, display, screen)
  • WGL: #include <glad/glad_wgl.h> and call gladLoadWGL(hdc) or gladLoadWGLLoader(loader, hdc)

Regenerating the loaders

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.

License

Apache-2.0. See headers for details.

About

Pre-generated OpenGL/EGL loaders.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published