From 91eabf1b4dbdfe7f96b934c5402619e29dcd5b76 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 28 Aug 2024 13:37:00 -0700
Subject: [PATCH] Fixed SDL_EGL_ChooseConfig()
---
src/video/SDL_egl.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c
index 7628e41ca1ae1..6d514fc55711a 100644
--- a/src/video/SDL_egl.c
+++ b/src/video/SDL_egl.c
@@ -926,21 +926,17 @@ static bool SDL_EGL_PrivateChooseConfig(SDL_VideoDevice *_this, bool set_config_
bool SDL_EGL_ChooseConfig(SDL_VideoDevice *_this)
{
- int ret;
-
if (!_this->egl_data) {
return SDL_SetError("EGL not initialized");
}
// Try with EGL_CONFIG_CAVEAT set to EGL_NONE, to avoid any EGL_SLOW_CONFIG or EGL_NON_CONFORMANT_CONFIG
- ret = SDL_EGL_PrivateChooseConfig(_this, true);
- if (ret == 0) {
+ if (SDL_EGL_PrivateChooseConfig(_this, true)) {
return true;
}
// Fallback with all configs
- ret = SDL_EGL_PrivateChooseConfig(_this, false);
- if (ret == 0) {
+ if (SDL_EGL_PrivateChooseConfig(_this, false)) {
SDL_Log("SDL_EGL_ChooseConfig: found a slow EGL config");
return true;
}