[Scummvm-git-logs] scummvm master -> 2d1b05bf173cd0b8fe511494f9b4775676199477

lephilousophe noreply at scummvm.org
Sat Feb 22 09:59:01 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2d1b05bf17 BACKENDS: SDL: Fix sdlGetAttribute shim on SDL2


Commit: 2d1b05bf173cd0b8fe511494f9b4775676199477
    https://github.com/scummvm/scummvm/commit/2d1b05bf173cd0b8fe511494f9b4775676199477
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-02-22T10:57:49+01:00

Commit Message:
BACKENDS: SDL: Fix sdlGetAttribute shim on SDL2

sdlGetAttribute returns true on success (like SDL_GL_GetAttribute on
SDL3), but SDL_GL_GetAttribute on SDL2 return 0 on success.

Changed paths:
    backends/graphics/openglsdl/openglsdl-graphics.cpp
    backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
    backends/platform/sdl/sdl.cpp


diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 1e84e21be32..f2aa953aa9d 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -60,7 +60,7 @@ static bool sdlGetAttribute(SDL_GLAttr attr, int *value) {
 }
 #else
 static bool sdlGetAttribute(SDL_GLattr attr, int *value) {
-	return SDL_GL_GetAttribute(attr, value) != 0;
+	return SDL_GL_GetAttribute(attr, value) == 0;
 }
 #endif
 
diff --git a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
index e7aa3b81ad7..c785f7162c2 100644
--- a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
+++ b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
@@ -52,7 +52,7 @@ static bool sdlGetAttribute(SDL_GLAttr attr, int *value) {
 }
 #else
 static bool sdlGetAttribute(SDL_GLattr attr, int *value) {
-	return SDL_GL_GetAttribute(attr, value) != 0;
+	return SDL_GL_GetAttribute(attr, value) == 0;
 }
 #endif
 
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 36e04dd0d10..4beb4c22961 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -85,7 +85,7 @@ static bool sdlGetAttribute(SDL_GLAttr attr, int *value) {
 }
 #elif SDL_VERSION_ATLEAST(2, 0, 0)
 static bool sdlGetAttribute(SDL_GLattr attr, int *value) {
-	return SDL_GL_GetAttribute(attr, value) != 0;
+	return SDL_GL_GetAttribute(attr, value) == 0;
 }
 #endif
 




More information about the Scummvm-git-logs mailing list