From e61b5ceefea3af0a93f485d68579f8e13dc1f304 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 18 May 2023 07:34:45 -0700
Subject: [PATCH] The SDL_WINDOW_ALLOW_HIGHDPI flag has been renamed
SDL_WINDOW_HIGH_PIXEL_DENSITY
---
build-scripts/SDL_migration.cocci | 4 ++++
docs/README-migration.md | 3 +--
include/SDL3/SDL_oldnames.h | 2 ++
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci
index 86acf1ff3328..1900e6d9b725 100644
--- a/build-scripts/SDL_migration.cocci
+++ b/build-scripts/SDL_migration.cocci
@@ -2644,3 +2644,7 @@ typedef SDL_cond, SDL_Condition;
@@
- AUDIO_U8
+ SDL_AUDIO_U8
+@@
+@@
+- SDL_WINDOW_ALLOW_HIGHDPI
++ SDL_WINDOW_HIGH_PIXEL_DENSITY
diff --git a/docs/README-migration.md b/docs/README-migration.md
index 0045cb29a762..f5270a831b1b 100644
--- a/docs/README-migration.md
+++ b/docs/README-migration.md
@@ -1085,8 +1085,6 @@ The SDL_WINDOWPOS_UNDEFINED_DISPLAY() and SDL_WINDOWPOS_CENTERED_DISPLAY() macro
The SDL_WINDOW_SHOWN flag has been removed. Windows are shown by default and can be created hidden by using the SDL_WINDOW_HIDDEN flag.
-The SDL_WINDOW_ALLOW_HIGHDPI flag has been renamed SDL_WINDOW_HIGH_PIXEL_DENSITY.
-
SDL_DisplayMode now includes the pixel density which can be greater than 1.0 for display modes that have a higher pixel size than the mode size. You should use SDL_GetWindowSizeInPixels() to get the actual pixel size of the window back buffer.
The refresh rate in SDL_DisplayMode is now a float.
@@ -1149,6 +1147,7 @@ The following functions have been removed:
SDL_Window id type is named SDL_WindowID
The following symbols have been renamed:
+* SDL_WINDOW_ALLOW_HIGHDPI => SDL_WINDOW_HIGH_PIXEL_DENSITY
* SDL_WINDOW_INPUT_GRABBED => SDL_WINDOW_MOUSE_GRABBED
## SDL_vulkan.h
diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h
index d9487a0fb5f5..073a165b3a6d 100644
--- a/include/SDL3/SDL_oldnames.h
+++ b/include/SDL3/SDL_oldnames.h
@@ -466,6 +466,7 @@
#define SDL_GetWindowDisplayMode SDL_GetWindowFullscreenMode
#define SDL_IsScreenSaverEnabled SDL_ScreenSaverEnabled
#define SDL_SetWindowDisplayMode SDL_SetWindowFullscreenMode
+#define SDL_WINDOW_ALLOW_HIGHDPI SDL_WINDOW_HIGH_PIXEL_DENSITY
#define SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_MOUSE_GRABBED
#elif !defined(SDL_DISABLE_OLD_NAMES)
@@ -895,6 +896,7 @@
#define SDL_GetWindowDisplayMode SDL_GetWindowDisplayMode_renamed_SDL_GetWindowFullscreenMode
#define SDL_IsScreenSaverEnabled SDL_IsScreenSaverEnabled_renamed_SDL_ScreenSaverEnabled
#define SDL_SetWindowDisplayMode SDL_SetWindowDisplayMode_renamed_SDL_SetWindowFullscreenMode
+#define SDL_WINDOW_ALLOW_HIGHDPI SDL_WINDOW_ALLOW_HIGHDPI_renamed_SDL_WINDOW_HIGH_PIXEL_DENSITY
#define SDL_WINDOW_INPUT_GRABBED SDL_WINDOW_INPUT_GRABBED_renamed_SDL_WINDOW_MOUSE_GRABBED
#endif /* SDL_ENABLE_OLD_NAMES */