File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ int main(void) {
4747 printf ("Unable to create window.\n" );
4848 return 1 ;
4949 }
50-
50+ // We need to load EGL before `eglInitialize()` and after it.
51+ // Otherwise glad loads EGL 1.0.
52+ // https://github.com/Dav1dde/glad/issues/177
5153 int egl_version = gladLoaderLoadEGL (NULL );
5254 if (!egl_version ) {
5355 printf ("Unable to load EGL.\n" );
@@ -61,12 +63,14 @@ int main(void) {
6163 printf ("Got no EGL display.\n" );
6264 return 1 ;
6365 }
64-
66+
6567 if (!eglInitialize (egl_display , NULL , NULL )) {
6668 printf ("Unable to initialize EGL\n" );
6769 return 1 ;
6870 }
6971
72+ // Try to load EGL again after calling `eglInitialize`, this time we pass the
73+ // `egl_display`.
7074 egl_version = gladLoaderLoadEGL (egl_display );
7175 if (!egl_version ) {
7276 printf ("Unable to reload EGL.\n" );
You can’t perform that action at this time.
0 commit comments