Commit adac3bd1e27c2c9535439ccce9fa64f120759613

Alexander Kanavin 2022-05-03T12:31:50

video: restore ability to disable fb accel via hint Somewhere in code refactoring between .20 and .22 this check was lost, and so the hint had no effect anymore.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index 059316a..cf3d54c 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2509,6 +2509,14 @@ SDL_CreateWindowFramebuffer(SDL_Window * window)
     if (!_this->checked_texture_framebuffer) {
         SDL_bool attempt_texture_framebuffer = SDL_TRUE;
 
+        /* See if the user or application wants to specifically disable the framebuffer */
+        const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION);
+        if (hint) {
+            if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0) {
+                attempt_texture_framebuffer = SDL_FALSE;
+            }
+        }
+
         if (_this->is_dummy) {  /* dummy driver never has GPU support, of course. */
             attempt_texture_framebuffer = SDL_FALSE;
         }