Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
5000b14
cmake: adds ON_DEMAND option
BigRedEye Jul 1, 2019
f55b4f9
c: implements on-demand for WGL
Dav1dde Jul 6, 2019
c6dcf51
files: update to latest specifications.
Dav1dde Jul 6, 2019
f9d011c
glad: fixes test failures.
Dav1dde Jul 6, 2019
0c83e53
c: implements runtime install/uninstall-ing of debug functions
Dav1dde Jul 6, 2019
c309b8f
c: fixes missing APIENTRY on C callbacks.
Dav1dde Dec 8, 2019
434695f
glad: Fix EGL loading for EGL_NO_DISPLAY on EGL 1.5 and above
thochstein Dec 10, 2019
abf0099
c: fixes invalid calling convention in WGL loader.
Dav1dde Dec 23, 2019
2e24389
glad: updates parser and generators to support vk 1.2.
Dav1dde Jan 19, 2020
bba732e
rust: disables Clippy to silence warnings
AlexApps99 Mar 4, 2020
231c175
cmake: fixes extension parsing (multiple and NONE)
Dav1dde Mar 7, 2020
19cc25d
glad: makes order of aliases predictable
Dav1dde Mar 23, 2020
b3409f1
c: silences clang "reserved-id-macro" warning in gl headers
Dav1dde Apr 3, 2020
135087c
c: extends gl guards to gl3, glext, glext3
Dav1dde Apr 3, 2020
dcd1e7f
glad: clarifies licensing in LICENSE file and readme
Dav1dde Apr 3, 2020
a3bbb2d
c: wraps code in `extern "C"` for C++ compilers
Dav1dde Apr 3, 2020
6e4758e
parse: properly parses "new" group attribute on enum elements
Dav1dde Apr 5, 2020
8f28e90
glad: fixes memory leak within memoize utility
Dav1dde Apr 6, 2020
91c7599
rust: adds multi-context support
lunabunn Mar 14, 2020
b8072c1
rust: adds mx example and minor impl polishing
Dav1dde Mar 23, 2020
850e4f1
main: mentions `{subcommand} --help` in global help string
Dav1dde Apr 18, 2020
fba0119
rust: implements Send and Sync traits for FnPtr
Dav1dde Apr 25, 2020
26229df
test: silences rust/gen/mx/001 test warning on recent rust compiler
Dav1dde Apr 25, 2020
e8a8dd3
c: fixes generation of struct aliases
nickclark2016 May 21, 2020
b0f1643
parse: fixes aliased enum types
Dav1dde Jun 5, 2020
ca498fb
files: updates to latest specifications
Dav1dde Jun 18, 2020
6467cd6
parse: honors api in require instruction
Dav1dde Jun 18, 2020
cd06d9a
c: fixes surplus of empty lines
Dav1dde Jun 18, 2020
12f9daa
c: stops generating glLoad* for on-demand
Dav1dde Jun 18, 2020
b405ebf
c: better error handling in glad_vk_get_extensions
gk7huki Aug 31, 2020
4518abc
c: scopes goto and removes unnecessary null checks
Dav1dde Sep 1, 2020
1d7b6e9
c: fixes potential segfault in vulkan extensions logic.
Dav1dde Sep 15, 2020
70fe2c0
cmake: improves cmake
WildRackoon Apr 21, 2021
994aa6e
test: fixes cmake test after recent changes
Dav1dde Apr 21, 2021
0bd4a89
c: zero-initializes parsed GL version numbers
Jul 15, 2021
f427c40
glad: adds OpenGL SC support for GL_VERSION string parsing
Jul 15, 2021
4532065
github: adds github actions
Dav1dde Jul 15, 2021
cab4e15
glad: fixes alias extension resolution
Dav1dde Jul 19, 2021
99f3088
test: removes reference to test container
Dav1dde Jul 19, 2021
6278602
c: fixes platform protection for debug builds
Dav1dde Aug 2, 2021
3970b3f
github: runs apt-get update before install
Dav1dde Aug 22, 2021
aa38f7a
rust: strips spec prefix from enumerations
Dav1dde Aug 22, 2021
2f31a7e
rust: reduces generated code by more specific imports
Dav1dde Aug 22, 2021
30368fe
rust: uses more macros for readability
Dav1dde Aug 22, 2021
369fba4
rust: fixes hardcoded mx ctx name
Dav1dde Sep 11, 2021
5fc92d7
cmake: fix extensions parsing in PowerShell
Attractadore Nov 9, 2021
2f498c3
glad: updates specification urls
Dav1dde Dec 21, 2021
1cf7de0
files: updates to latest specifications
Dav1dde Dec 21, 2021
a4420ca
glad: fixes remaining resource URLs
Dav1dde Dec 22, 2021
568d0e6
glad: adds support for bitwidth=64 enums
Dav1dde Dec 22, 2021
01ca2d2
test: fixes C egl tests
Dav1dde Dec 22, 2021
2c472ae
c: fixes include requirements for vulkan
Dav1dde Dec 22, 2021
83ba9fb
rust: implements bitwidth for enums
Dav1dde Dec 22, 2021
f302831
c: fixes bitwidth and empty enum aliasing
Dav1dde Jan 31, 2022
0148445
files: updates to latest specifications
Dav1dde Jan 31, 2022
7a3c14c
rust: fixes aliases to empty enums
Dav1dde Jan 31, 2022
056ad45
c: stops referencing global enum variables by name
Dav1dde Mar 8, 2022
e3c1573
glad: fixes compatibility with jinja 3.1
Dav1dde Mar 31, 2022
cb8171c
glad: bumps jinja2 version to range 2.7-3
Dav1dde Mar 31, 2022
68c595d
glad: actually fixes compatibility with jinja 3.1
Dav1dde Mar 31, 2022
df20d05
c: implements _MAX_ENUM values
Dav1dde Apr 29, 2022
b105140
c: fixes aliasing for egl, glx and wgl
Dav1dde Apr 29, 2022
e0b64d9
c: store mx-global context as a pointer
haasn Oct 21, 2022
24ddbba
c: moves global static handle out of getter, initializes handle by de…
Dav1dde Oct 21, 2022
e4015c5
c: store handles inside mx struct
Oct 21, 2022
41ab48e
glad: expose Type's parent and Member's enum
pipehuffer May 31, 2022
c469e78
glad: add is_descendant method to Type
pipehuffer Jun 10, 2022
cf4badb
c: disables MX_GLOBAL
Dav1dde Oct 21, 2022
d7cd6b4
glad: minor cleanup of member type
Dav1dde Oct 21, 2022
07045ac
glad: removes broken/usupported generators
Dav1dde Oct 21, 2022
11f5ac7
glad: adds SPDX license identifiers
Dav1dde Oct 21, 2022
4639f1a
c: adds GLAD_UNUSED macro
Dav1dde Oct 21, 2022
5548cef
c: adds more GLES include guards
Dav1dde Oct 21, 2022
55b21bf
glad: updates bundled specifications
Dav1dde Oct 21, 2022
4a11682
glad: preparations for glad2 release
Dav1dde Oct 21, 2022
dcc4f69
setup: Bumped version: 2.0.0.
Dav1dde Oct 21, 2022
0ef9e4e
c: fixes gles2 loader issues
Dav1dde Oct 24, 2022
d5e41c6
c: properly fixes gles2 loader
Dav1dde Oct 24, 2022
525eddb
setup: Bumped version: 2.0.1.
Dav1dde Oct 25, 2022
d7f961e
glad: switches from pkg_resources to importlib.metadata
Dav1dde Oct 28, 2022
0106fe7
glad: improves compatibility for importlib.metadata
Dav1dde Oct 28, 2022
74e6688
glad: improves importlib.metadata fallbacks
Dav1dde Oct 28, 2022
f237a2b
setup: Bumped version: 2.0.2.
Dav1dde Oct 28, 2022
e576e95
glad: fixes plugin issues with pytho 3.8 and 3.9
Dav1dde Jan 3, 2023
47c20c1
setup: Bumped version: 2.0.3.
Dav1dde Jan 3, 2023
3e07944
test: removes old unittests
Dav1dde Feb 3, 2023
101c01c
glad: adds support for nested api attributes
Dav1dde Feb 17, 2023
3c2e433
cmake: fixes "duplicate build rules" error
shamanDevel Feb 6, 2023
da4747c
files: updates to latest specifications
Dav1dde Feb 17, 2023
a0a1314
ci: bump actions versions
scribam Jan 16, 2023
71f3063
glad: adds missing vulkan headers
Dav1dde Feb 17, 2023
d08b1aa
setup: Bumped version: 2.0.4.
Dav1dde Feb 17, 2023
3b95bf4
glad: removes rogue print statement
Dav1dde Feb 18, 2023
1377964
c: fixes broken newlines in headers when loaded with CRLF line endings
Dav1dde Apr 4, 2023
2348b07
c: actually fixes newline issue in headers
Dav1dde Apr 4, 2023
08eb15c
c: fixes merged gl loaders
Dav1dde Dec 26, 2023
4196306
c: allow to use system egl for gles2
Dav1dde Dec 26, 2023
e28d1f0
cmake: use FindPython instead of FindPythonInterp
gaboroszkar Dec 26, 2023
74b377a
cmake: honor `BUILD_SHARED_LIBS`
Dav1dde Dec 26, 2023
eb4e3f2
cmake: documents `REPRODUCIBLE` option
Dav1dde Dec 26, 2023
4d8a8d6
cmake: only add C files for non-header
Dav1dde Dec 26, 2023
d535dee
glad: add --version option to command-line interface
zopsicle Dec 26, 2023
f241d94
c: remove one duplicated check for glGetString(GL_VERSION)
z-s-e Dec 26, 2023
eb747c5
cmake: fixes cmake typo creating the wrong dir
Dav1dde Dec 26, 2023
7a7c639
cmake: adds note that paths should/must be absolute
Dav1dde Dec 26, 2023
73eaae0
c: fix extensions loading and parsing
lephilousophe Dec 31, 2023
b3a3644
cmake: provide CMake package (#453)
cNoNim Feb 4, 2024
7e52c19
c: fixes vulkan video headers
Dav1dde Feb 4, 2024
1a3611f
files: updates to latest specifications
Dav1dde Feb 4, 2024
f443700
setup: Bumped version: 2.0.5.
Dav1dde Feb 4, 2024
821bf3a
c: fixes compile warning when GLAD_GLES2_USE_SYSTEM_EGL is set (#456)
halx99 Feb 14, 2024
adc3d7a
cmake: Use include instead of find_package for CMake config (#457)
spnda Feb 23, 2024
463b2b2
c: don't warn on undefined GLAD_GLES2_USE_SYSTEM_EGL (#461)
haasn Mar 16, 2024
51b787e
c: fixes include header replacement
Dav1dde Mar 18, 2024
f8e93fb
files: updates to latest specifications
Dav1dde Mar 18, 2024
658f48e
setup: Bumped version: 2.0.6.
Dav1dde Mar 18, 2024
5dd44f1
example: defines GLAD_GL_IMPLEMENTATION in GLFW example (#464)
vainangel Apr 7, 2024
976973c
files: lookup resources via importlib if available
Dav1dde May 20, 2024
2ae8255
ci: bump actions versions (#472)
scribam May 31, 2024
92fce6b
c: add missing voids to functions
Dav1dde Aug 24, 2024
8dc0d4d
parse: features are only direct children of the root node
Dav1dde Aug 24, 2024
ce26b54
setup: Bumped version: 2.0.7.
Dav1dde Sep 5, 2024
0127717
rust: replace static mut references with addr_of
Dav1dde Sep 6, 2024
7b120b2
glad: replace setup.py with pyproject.toml (#490)
gadjalin Sep 29, 2024
f62a12a
readme: add plugin section
Dav1dde Sep 29, 2024
b3a6c5c
files: updates to latest specifications
Dav1dde Sep 29, 2024
8d85f4a
utility: use modern version to build package
Dav1dde Sep 29, 2024
73db193
setup: Bumped version: 2.0.8.
Dav1dde Sep 29, 2024
f492295
cmake: adds missing CMake vulkan example and removes extra white spac…
ltsdw Oct 17, 2024
7acc116
example: closes win32 window properly in WGL example (#504)
carsonalh Jan 25, 2025
56e406e
c: silence VS 'function call missing argument list' warnings
Dav1dde Mar 26, 2025
431786d
rust: makes struct members pub
Dav1dde May 11, 2025
27bed11
vk: pins vulkan spec to working commit
Dav1dde Oct 27, 2025
ff234d8
example: clarifies EGL loading steps with comments (#531)
ritchielrez Jan 18, 2026
bc4a7fb
example: adds SDL3 example (#532)
eloj Jan 31, 2026
a4ca574
example: adds SDL3 example (callback main) (#533)
eloj Jan 31, 2026
cef3f89
c: Try loading OpenGL through EGL if GLX isn't available (#536)
ziyao233 Apr 9, 2026
e3c14f9
ci: fix build and bump action versions (#540)
scribam Jun 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/glad2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on: [push, pull_request]

name: glad2

jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
WINEDLLOVERRIDES: mscoree,mshtml=
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.x'
cache: 'pip'
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Install dependencies
run: |
# Install wine
sudo mkdir -pm755 /etc/apt/keyrings
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -
sudo dpkg --add-architecture i386
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
sudo apt-get update
sudo apt install --install-recommends winehq-stable
# Install remaining dependencies
sudo apt-get install gcc g++ gcc-mingw-w64 g++-mingw-w64 rustc libglfw3-dev winetricks xvfb libxxf86vm-dev libxi-dev libxcursor-dev libxinerama-dev
- name: Setup environment
run: winetricks nocrashdialog
- name: Run Tests
run: PRINT_MESSAGE=1 xvfb-run --auto-servernum ./utility/test.sh
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: test-report.xml
comment_mode: off
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ a.out
*.kdev_include_paths
main.c
*.diff
*.swp
.idea
dist/
*.egg-info
Expand All @@ -17,4 +18,5 @@ dist/
/glad-rs/
/rust/
target/
Cargo.lock
Cargo.lock
.vscode/
32 changes: 0 additions & 32 deletions Jenkinsfile

This file was deleted.

83 changes: 63 additions & 20 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,20 +1,63 @@
The MIT License (MIT)

Copyright (c) 2013-2018 David Herberth

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The glad source code:

The MIT License (MIT)

Copyright (c) 2013-2022 David Herberth

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


The Khronos Specifications:

Copyright (c) 2013-2020 The Khronos Group Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


The EGL Specification and various headers:

Copyright (c) 2007-2016 The Khronos Group Inc.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.

THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ glad
====

Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specifications
for multiple languages, including C/C++/Rust/D/Nim/Volt/Pascal.
for multiple languages.

Check out the [webservice for glad2](https://glad.sh) to generate the files you need!


**NOTE:** The 2.0 branch is currently a beta version, the beta version number will
not be updated and refers to the git *HEAD*.
**NOTE:** This is the 2.0 branch, which adds more functionality but changes the API.

Some languages are only available in the [glad1 generator](https://glad.dav1d.de).

Expand Down Expand Up @@ -43,6 +42,12 @@ The full code: [hellowindow2.cpp](example/c++/hellowindow2.cpp)

More examples in the [examples directory](example/) of this repository.

## Plugins

Glad [plugins](https://github.com/Dav1dde/glad/wiki/Extending-Glad)
maintained by the community to add support for more languages:

- [Fortran](https://github.com/AarnoldGad/glad-fortran).

## Documentation

Expand All @@ -54,7 +59,9 @@ Examples can be found [in the example directory](/example). Some examples:
* C/C++
* [GL GLFW](example/c/gl_glfw.c)
* [GL GLFW On-Demand loading](example/c/gl_glfw_on_demand.c)
* [GL GLFW Multiple Windows](example/c++/multiwin_mx/)
* [GL GLFW Multiple Windows/Contexts](example/c++/multiwin_mx/)
* [GL SDL3 Callbacks](example/c/gl_sdl3_callbacks.c)
* [GL SDL3](example/c/gl_sdl3.c)
* [GL SDL2](example/c/gl_sdl2.c)
* [Vulkan GLFW](example/c/vulkan_tri_glfw/)
* [GLX](example/c/glx.c)
Expand All @@ -63,5 +70,16 @@ Examples can be found [in the example directory](/example). Some examples:
* [EGL X11](example/c/egl_x11/)
* Rust
* [GL GLFW](example/rust/gl-glfw/)
* [GL GLFW Multiple Windows/Contexts](example/rust/gl-glfw-mx/)



## License

For the source code and various Khronos files see [LICENSE](/LICENSE).

The generated code from glad is any of Public Domain, WTFPL or CC0.
Now Khronos has some of their specifications under Apache Version 2.0
license which may have an impact on the generated code,
[see this clarifying comment](https://github.com/KhronosGroup/OpenGL-Registry/issues/376#issuecomment-596187053)
on the Khronos / OpenGL-Specification issue tracker.
Loading