MCPcopy Index your code
hub / github.com/Dav1dde/glad

github.com/Dav1dde/glad @v2.0.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.8 ↗ · + Follow
778 symbols 1,501 edges 199 files 46 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

glad

Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specifications for multiple languages.

Check out the webservice for glad2 to generate the files you need!

NOTE: This is the 2.0 branch, which adds more functionality but changes the API.

Some languages are only available in the glad1 generator.

Examples

#include <glad/gl.h>
// GLFW (include after glad)
#include <GLFW/glfw3.h>


int main() {
    // -- snip --

    GLFWwindow* window = glfwCreateWindow(WIDTH, HEIGHT, "LearnOpenGL", NULL, NULL);
    glfwMakeContextCurrent(window);

    int version = gladLoadGL(glfwGetProcAddress);
    if (version == 0) {
        printf("Failed to initialize OpenGL context\n");
        return -1;
    }

    // Successfully loaded OpenGL
    printf("Loaded OpenGL %d.%d\n", GLAD_VERSION_MAJOR(version), GLAD_VERSION_MINOR(version));

    // -- snip --
}

The full code: hellowindow2.cpp

More examples in the examples directory of this repository.

Plugins

Glad plugins maintained by the community to add support for more languages:

Documentation

The documentation can be found in the wiki.

Examples can be found in the example directory. Some examples:

License

For the source code and various Khronos files see 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 on the Khronos / OpenGL-Specification issue tracker.

Core symbols most depended-on inside this repo

get
called by 64
glad/config.py
find
called by 23
glad/parse.py
gladLoaderLoadGL
called by 22
glad/generator/c/templates/loader/gl.c
from_element
called by 18
glad/parse.py
load
called by 14
glad/generator/rust/templates/impl.rs
items
called by 13
glad/config.py
gladLoaderLoadVulkan
called by 13
glad/generator/c/templates/loader/vulkan.c
loadable
called by 12
glad/generator/c/__init__.py

Shape

Function 332
Method 217
Class 187
Enum 42

Languages

Python43%
C33%
C++18%
Rust7%

Modules by API surface

glad/parse.py137 symbols
example/c/vulkan_tri_glfw/vulkan_tri_glfw.c41 symbols
glad/generator/__init__.py38 symbols
glad/config.py38 symbols
glad/generator/c/__init__.py31 symbols
glad/files/vulkan_video_codec_av1std.h29 symbols
glad/files/vulkan_video_codec_h265std.h25 symbols
glad/sink.py21 symbols
glad/files/vulkan_video_codec_h264std.h21 symbols
glad/util.py14 symbols
glad/generator/rust/__init__.py14 symbols
glad/specification.py12 symbols

For agents

$ claude mcp add glad \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page