GLAD Extensions
Fix missing extensions in OpenGLES
GLAD is a runtime loader-generator for Vulkan/GL/GLES/EGL/GLX/WGL. There is a great web tool to generate glad.h and glad.cpp files we need (https://glad.dav1d.de/).
Recently, i was using GL_TIME_ELAPSED_EXT in my code to do the time query of my opengl rendering task, but found that GL_TIME_ELAPSED_EXT is not defined. The main reason is that in OpenGLES, timer queries are not core, even in ES 3.2. They are extension-only. So if GLAD wasn’t generated with that extension enabled, the macro will simply not exist.
To fix this, we have to manually include the extension GL_EXT_disjoint_timer_query, which GL_TIME_ELAPSED_EXT comes from, when generating the GLAD files.
Then, the generated glad.h file will contain the definition of GL_TIME_ELAPSED_EXT.
1 |
GLAD Extensions
