Calling gladLoadGLES2 with Mesa implementation returns 0 because GLES2 functions are resolved but extensions parsing failed.
This is due to the fact that Mesa returns GLES version 3.2 and glad_gl_get_extensions gets called with this 3.2 version.
GLAD_GL_IS_SOME_NEW_VERSION is defined because GL_VERSION_3_0 is defined (as we generate it).
The version check occurs and ends up in the version >= 3 branch.
Sadly, the GLES2 loader code didn't try to initialize glad_glGetStringi (as it's not defined in GLES2) and the sanity check fails which makes loading extensions fail.
it seems to me that glad_gl_get_extensions should depend on the API calling it and if GLES2 is used, it should always use the basic glad_glGetString(GL_EXTENSIONS) call.
Using glad 2.0.4 with the following settings.
Calling
gladLoadGLES2
with Mesa implementation returns 0 because GLES2 functions are resolved but extensions parsing failed.This is due to the fact that Mesa returns GLES version 3.2 and
glad_gl_get_extensions
gets called with this 3.2 version.GLAD_GL_IS_SOME_NEW_VERSION
is defined becauseGL_VERSION_3_0
is defined (as we generate it). The version check occurs and ends up in theversion >= 3
branch. Sadly, the GLES2 loader code didn't try to initializeglad_glGetStringi
(as it's not defined in GLES2) and the sanity check fails which makes loading extensions fail.it seems to me that
glad_gl_get_extensions
should depend on the API calling it and if GLES2 is used, it should always use the basicglad_glGetString(GL_EXTENSIONS)
call.The same should occur for GLES1.
Thanks.