Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions example/c/egl_x11/egl_x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ int main(void) {
printf("Unable to create window.\n");
return 1;
}

// We need to load EGL before `eglInitialize()` and after it.
// Otherwise glad loads EGL 1.0.
// https://github.com/Dav1dde/glad/issues/177
int egl_version = gladLoaderLoadEGL(NULL);
if (!egl_version) {
printf("Unable to load EGL.\n");
Expand All @@ -61,12 +63,14 @@ int main(void) {
printf("Got no EGL display.\n");
return 1;
}

if (!eglInitialize(egl_display, NULL, NULL)) {
printf("Unable to initialize EGL\n");
return 1;
}

// Try to load EGL again after calling `eglInitialize`, this time we pass the
// `egl_display`.
egl_version = gladLoaderLoadEGL(egl_display);
if (!egl_version) {
printf("Unable to reload EGL.\n");
Expand Down
Loading