Dav1dde/glad
FreeMulti-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.
FreeFree tier
About Dav1dde/glad
glad is an open-source multi-language loader-generator for Vulkan, OpenGL, OpenGL ES, EGL, GLX, and WGL. It generates platform-specific code to load graphics API functions dynamically from the official Khronos specifications, supporting languages such as C, C++, Python, Rust, Pascal, Nim, and D. The project includes a web service (glad2) for easy generation of loader files, community-maintained plugins (e.g., for Fortran), and examples integrating with GLFW, SDL2, SDL3, and more. The generated code is released under public domain, WTFPL, or CC0 licenses.
Key Features
Supports multiple graphics APIs: Vulkan, OpenGL, OpenGL ES, EGL, GLX, WGL
Generates loader code in multiple languages: C, C++, Python, Rust, Pascal, Nim, D, and more via plugins
Based on official Khronos specifications for accurate function signatures
Provides a web service (glad2) for convenient file generation
Community plugins extend language support (e.g., Fortran)
Includes examples for GLFW, SDL2, SDL3, and other frameworks
Open-source with permissive licensing for generated code (Public Domain, WTFPL, CC0)
Pros & Cons
Pros
- Based on official Khronos specifications, ensuring accuracy
- Supports a wide range of languages through core and community plugins
- Easily accessible via a web service for quick file generation
- Permissive licensing of generated code reduces legal friction
- Active development with regular releases (v2.0.8 as of Sep 2024)
- Well-documented with a wiki and example code
Cons
- API changes between glad1 and glad2 may require migration effort
- Some language generators are only available in the older glad1 branch
- Requires understanding of graphics API loading concepts to use effectively
- Limited to desktop/mobile platforms supported by the underlying APIs
Best For
Loading OpenGL or Vulkan functions dynamically in C/C++ applicationsCreating multi-platform graphics applications without static linking to vendor librariesGenerating language bindings for graphics APIs (e.g., Rust, Python)Integrating with windowing libraries like GLFW or SDL for context creationEducational purposes for understanding graphics API loading mechanisms
FAQ
What is glad?
glad is a multi-language loader-generator for Vulkan, OpenGL, OpenGL ES, EGL, GLX, and WGL. It generates code to load graphics API functions dynamically based on the official Khronos specifications.
How do I use glad to generate loader files?
You can use the web service at gen.glad.sh/ to generate the required files for your language and API version. Alternatively, you can use the command-line tool or integrate it into your build system.
What license does the generated code have?
The generated code from glad is released under any of Public Domain, WTFPL, or CC0 licenses. The source code of glad itself is licensed as specified in the repository's LICENSE file.
Which languages does glad support?
glad natively supports C, C++, Python, and Rust. Community plugins add support for additional languages such as Fortran. The glad1 branch also supports Pascal, Nim, D, and others.
Is glad compatible with glad1?
The current version is glad2, which has API changes compared to glad1. Some language generators are only available in glad1. The repository provides both branches.