From b0860fb0c2fd6cd0fd7cf4269fed415500627753 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Mon, 7 Apr 2025 20:38:05 +0100 Subject: [PATCH] Disable EGL in Emscripten builds --- CMakeLists.txt | 1 - src/video/SDL_egl.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73949437ba..364cb5c0fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1549,7 +1549,6 @@ elseif(EMSCRIPTEN) #enable gles if(SDL_OPENGLES) - set(SDL_VIDEO_OPENGL_EGL 1) set(HAVE_OPENGLES TRUE) set(SDL_VIDEO_OPENGL_ES2 1) set(SDL_VIDEO_RENDER_OGL_ES2 1) diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 72ad999c5d..3d4df26073 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -258,7 +258,7 @@ SDL_FunctionPointer SDL_EGL_GetProcAddressInternal(SDL_VideoDevice *_this, const result = _this->egl_data->eglGetProcAddress(proc); } -#if !defined(SDL_PLATFORM_EMSCRIPTEN) && !defined(SDL_VIDEO_DRIVER_VITA) // LoadFunction isn't needed on Emscripten and will call dlsym(), causing other problems. +#if !defined(SDL_VIDEO_DRIVER_VITA) // Try SDL_LoadFunction() first for EGL <= 1.4, or as a fallback for >= 1.5. if (!result) { result = SDL_LoadFunction(_this->egl_data->opengl_dll_handle, proc);