From 29d9c3efaf615edcbe87541997febb8ad9ce982f Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Mon, 5 Aug 2024 10:26:29 -0700
Subject: [PATCH] Updated for SDL3 log prefix changes
---
src/sdl2_compat.c | 7 +++++++
src/sdl3_syms.h | 1 +
2 files changed, 8 insertions(+)
diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index 77d13eb..bdbd68e 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -838,6 +838,13 @@ SDL2Compat_InitOnStartup(void)
SDL3_SetHint("SDL_VIDEO_SYNC_WINDOW_OPERATIONS", "1");
SDL3_SetHint(SDL_HINT_WINDOWS_RAW_KEYBOARD, "0");
+ SDL3_SetLogPriorityPrefix(SDL_LOG_PRIORITY_VERBOSE, "VERBOSE: ");
+ SDL3_SetLogPriorityPrefix(SDL_LOG_PRIORITY_DEBUG, "DEBUG: ");
+ SDL3_SetLogPriorityPrefix(SDL_LOG_PRIORITY_INFO, "INFO: ");
+ SDL3_SetLogPriorityPrefix(SDL_LOG_PRIORITY_WARN, "WARN: ");
+ SDL3_SetLogPriorityPrefix(SDL_LOG_PRIORITY_ERROR, "ERROR: ");
+ SDL3_SetLogPriorityPrefix(SDL_LOG_PRIORITY_CRITICAL, "CRITICAL: ");
+
return 1;
fail:
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index 5afbf8d..524ce85 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -843,6 +843,7 @@ SDL3_SYM(SDL_Surface *,ConvertSurfaceAndColorspace,(SDL_Surface *a, SDL_PixelFor
SDL3_SYM(SDL_Palette *,CreateSurfacePalette,(SDL_Surface *a),(a),return)
SDL3_SYM(SDL_Palette *,GetSurfacePalette,(SDL_Surface *a),(a),return)
SDL3_SYM(int,StartTextInputWithProperties,(SDL_Window *a, SDL_PropertiesID b),(a,b),return)
+SDL3_SYM(int,SetLogPriorityPrefix,(SDL_LogPriority a, const char *b),(a,b),return)
#undef SDL3_SYM
#undef SDL3_SYM_PASSTHROUGH