mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-27 14:24:13 +08:00
EGL: Ensure the platform extensions exist before using them
The EXT and KHR variants use the same constant values, but the EXT versions are available a bit further back.
This commit is contained in:
@@ -37,10 +37,15 @@
|
||||
|
||||
int Wayland_GLES_LoadLibrary(_THIS, const char *path)
|
||||
{
|
||||
int ret;
|
||||
SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
|
||||
int ret;
|
||||
#ifdef EGL_EXT_platform_wayland
|
||||
const EGLenum platform = EGL_PLATFORM_WAYLAND_EXT;
|
||||
#else
|
||||
const EGLenum platform = 0;
|
||||
#endif
|
||||
|
||||
ret = SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display, EGL_PLATFORM_WAYLAND_KHR);
|
||||
ret = SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display, platform);
|
||||
|
||||
Wayland_PumpEvents(_this);
|
||||
WAYLAND_wl_display_flush(data->display);
|
||||
|
||||
@@ -32,6 +32,11 @@
|
||||
int X11_GLES_LoadLibrary(_THIS, const char *path)
|
||||
{
|
||||
SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
|
||||
#ifdef EGL_EXT_platform_x11
|
||||
const EGLenum platform = EGL_PLATFORM_X11_EXT;
|
||||
#else
|
||||
const EGLenum platform = 0;
|
||||
#endif
|
||||
|
||||
/* If the profile requested is not GL ES, switch over to X11_GL functions */
|
||||
if ((_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) &&
|
||||
@@ -53,8 +58,7 @@ int X11_GLES_LoadLibrary(_THIS, const char *path)
|
||||
#endif
|
||||
}
|
||||
|
||||
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display,
|
||||
EGL_PLATFORM_X11_KHR);
|
||||
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display, platform);
|
||||
}
|
||||
|
||||
XVisualInfo *X11_GLES_GetVisual(_THIS, Display *display, int screen)
|
||||
|
||||
Reference in New Issue
Block a user