From 07328791593e3def26cda38423b208e55fbc0e84 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sat, 15 Mar 2025 02:04:43 +0100
Subject: [PATCH] In SDL2, SDL_WasInit(0) is equivalent to
SDL_WasInit(SDL_INIT_EVERYTHING)
---
src/sdl2_compat.c | 3 +++
src/sdl2_compat.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 4978f9c..f2105eb 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -6857,6 +6857,9 @@ SDL_DECLSPEC Uint32 SDLCALL
SDL_WasInit(Uint32 flags)
{
Uint32 result = SDL3_WasInit(flags);
+ if (flags == 0) {
+ flags = SDL2_INIT_EVERYTHING;
+ }
if ((flags & SDL2_INIT_TIMER) && timer_init) {
result |= SDL2_INIT_TIMER;
}
diff --git a/src/sdl2_compat.h b/src/sdl2_compat.h
index 2aad6c2..bc8e5bd 100644
--- a/src/sdl2_compat.h
+++ b/src/sdl2_compat.h
@@ -41,6 +41,7 @@ typedef enum
/* removed in SDL3 */
#define SDL2_INIT_TIMER 0x00000001u
+#define SDL2_INIT_EVERYTHING 0x0000f231u
/* removed in SDL3 (which only uses SDL_WINDOW_HIDDEN now). */
#define SDL2_WINDOW_SHOWN 0x000000004