Dav1dde / glad

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

Home Page:https://glad.dav1d.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The head guard of glad/gl.h won't work as it should when header only is selected in glad2 generator

kiroeko opened this issue · comments

commented

Problems arise when multiple sources refer to header files in a specific order.
s

This is on purpose and follows the same pattern what the stb* libs use.

Include glad with GLAD_GL_IMPLEMENTATION in a singular .c file as the last include:

#include ...
#include ...
#include ...
#define GLAD_GL_IMPLEMENTATION
#include <glad/gl.h>

This could be your main.c or a separate source file which only includes glad and nothing else.