Dav1dde / glad

Multi-Language Vulkan/GL/GLES/EGL/GLX/WGL Loader-Generator based on the official specs.
https://glad.dav1d.de/
Other
3.79k stars 448 forks source link

Option to generate extern declarations for non-extension EGL functions #416

Closed zopsicle closed 1 year ago

zopsicle commented 1 year ago

gladLoadEGL takes a display, which must be obtained with prior calls to EGL, which must therefore be loaded some other way. eglGetProcAddress must also be loaded some other way. It would be handy if glad could generate extern declarations rather than macro definitions for non-extension EGL functions, to be linked directly with libEGL.so.

Dav1dde commented 1 year ago

You can just pass null, acquire a device and then load again.

There is an example which loads a base EGL without device https://github.com/Dav1dde/glad/blob/3b95bf4f9a7a034374092d625e391ddac43fe66f/example/c/egl_x11/egl_x11.c#L51 and later loads again with a device https://github.com/Dav1dde/glad/blob/3b95bf4f9a7a034374092d625e391ddac43fe66f/example/c/egl_x11/egl_x11.c#L70