Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 856 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 856 Bytes

glad

GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.

Check out the webservice to generate the files you need!

Examples

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


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

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

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

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

    // -- snip --
}

The full code: hellowindow2.cpp

More examples in the examples directory of this repository.