A cross-platform C++ rendering library that abstracts over Direct3D, Metal, OpenGL, Vulkan and WebGL so you can bring your own engine.
Dav1dde/glad
A loader-generator that produces C/C++ and other language bindings for OpenGL, Vulkan, EGL, GLX and WGL from the official specifications.
- Stars
- 4,629
- Forks
- 514
- Open issues
- 33
- Last commit
- last month
What is it?
glad generates loader code for graphics APIs such as OpenGL, OpenGL ES, Vulkan, EGL, GLX and WGL. Graphics drivers expose most of these functions at runtime rather than through linked libraries, so applications need a loader to look up function pointers before they can call them. glad builds that loader from the official API specifications, so you choose the API version and extensions you need and receive matching header and source files.
The project is a generator with a web service at gen.glad.sh where you select the API, version, profile and extensions and download the generated files. Output is available for several languages; the README lists C and C++ examples and Rust examples, and notes that some languages are only available in the earlier glad1 generator. A community plugin adds Fortran support.
The examples cover common windowing libraries, including GLFW and SDL2/SDL3, as well as raw GLX, WGL and EGL setups.
Key features
- 01Generates loaders for OpenGL, OpenGL ES, Vulkan, EGL, GLX and WGL.
- 02Built from the official API specifications, with selectable versions and extensions.
- 03Available as a web service for choosing options and downloading generated files.
- 04Provides C/C++ and Rust examples, with bindings for other languages via plugins.
Use cases
- Setting up an OpenGL or Vulkan renderer in a C or C++ application with GLFW or SDL.
- Generating a loader pinned to a specific OpenGL version and extension set.
- Writing a graphics program in Rust that needs GL function pointers.
Quick start
- 1
Generate the loader files you need with the glad2 webservice
- 2
Include the generated header (for example glad/gl.h) and call gladLoadGL with your windowing library's loader
Things to know
- Some languages are only available in the older glad1 generator.
- This is the 2.0 branch, which changes the API from earlier versions.
- The license is not clearly detected, and some bundled Khronos specifications fall under Apache 2.0.
Topics
FAQ
- What is glad?
- A loader-generator that produces C/C++ and other language bindings for OpenGL, Vulkan, EGL, GLX and WGL from the official specifications. glad generates loader code for graphics APIs such as OpenGL, OpenGL ES, Vulkan, EGL, GLX and WGL. Graphics drivers expose most of these functions at runtime rather than through linked libraries, so applications need a loader to look up function pointers before they can call them. glad builds that loader from the official API specifications, so you choose the API version and extensions you need and receive matching header and source files.
- Is glad free to use? What license does it have?
- glad is open source under the Other license. Check the license terms before using it in commercial products.
- Is glad still maintained?
- Updated within 6 months. The last commit to glad was on Sep 28, 2026.
- What can I use glad for?
- Setting up an OpenGL or Vulkan renderer in a C or C++ application with GLFW or SDL. Generating a loader pinned to a specific OpenGL version and extension set. Writing a graphics program in Rust that needs GL function pointers.
- How do I install glad?
- Generate the loader files you need with the glad2 webservice Include the generated header (for example glad/gl.h) and call gladLoadGL with your windowing library's loader
- Where can I get glad?
- The source code and installation instructions are on GitHub: https://github.com/Dav1dde/glad
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
OGRE is a modular C++ rendering engine that abstracts Vulkan, Direct3D and OpenGL for building 3D applications in C++ and Python.
A cross-platform C++17 UI framework with GLFW/SDL2 window backends and OpenGL/Vulkan rendering, built around a declarative DSL.
A cross-platform C++20 3D library with a three.js-style API, OpenGL and Vulkan backends, Python bindings, and physics and sensor simulation.
Generates API client SDKs, server stubs, and docs in dozens of languages and frameworks from OpenAPI specs (v2 and v3).
A real-time physically based rendering engine for Android, iOS, Linux, macOS, Windows and WebGL2, designed to be small and efficient on Android.