update sdl to 2.32.6

This commit is contained in:
AzaezelX 2025-05-24 13:39:03 -05:00
parent e557f5962b
commit ddc1f8c1e2
1339 changed files with 53966 additions and 19207 deletions

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
/*
* Windows includes:

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
/* Windows includes */
#include <roapi.h>
@ -116,7 +116,7 @@ static void WINRT_HandleGameBarIsInputRedirected_MainThread()
return;
}
gameBar = WINRT_GetGameBar();
if (gameBar == NULL) {
if (!gameBar) {
/* Shouldn't happen, but just in case... */
return;
}
@ -167,11 +167,11 @@ void WINRT_QuitGameBar(_THIS)
{
SDL_VideoData *driverdata;
IGameBarStatics_ *gameBar;
if (_this == NULL || _this->driverdata == NULL) {
if (!_this || !_this->driverdata) {
return;
}
gameBar = WINRT_GetGameBar();
if (gameBar == NULL) {
if (!gameBar) {
return;
}
driverdata = (SDL_VideoData *)_this->driverdata;

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
/* Windows-specific includes */
#include <Windows.h>

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
extern "C" {
#include "SDL_messagebox.h"
@ -35,15 +35,15 @@ using namespace Windows::Foundation;
using namespace Windows::UI::Popups;
static String ^ WINRT_UTF8ToPlatformString(const char *str) {
wchar_t *wstr = WIN_UTF8ToString(str);
wchar_t *wstr = WIN_UTF8ToStringW(str);
String ^ rtstr = ref new String(wstr);
SDL_free(wstr);
return rtstr;
}
extern "C" int WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
extern "C" int WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
{
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION == NTDDI_WIN8)
#if SDL_WINAPI_FAMILY_PHONE && (NTDDI_VERSION == NTDDI_WIN8)
/* Sadly, Windows Phone 8 doesn't include the MessageDialog class that
* Windows 8.x/RT does, even though MSDN's reference documentation for
* Windows Phone 8 mentions it.
@ -55,7 +55,7 @@ static String ^ WINRT_UTF8ToPlatformString(const char *str) {
#else
SDL_VideoDevice *_this = SDL_GetVideoDevice();
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#if SDL_WINAPI_FAMILY_PHONE
const int maxbuttons = 2;
const char *platform = "Windows Phone 8.1+";
#else
@ -106,7 +106,7 @@ static String ^ WINRT_UTF8ToPlatformString(const char *str) {
*buttonid = messageboxdata->buttons[clicked_index].buttonid;
}
return 0;
#endif /* if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP / else */
#endif /* if SDL_WINAPI_FAMILY_PHONE / else */
}
#endif /* SDL_VIDEO_DRIVER_WINRT */

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
extern int WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
/*
* Windows includes:
@ -215,7 +215,7 @@ void WINRT_InitMouse(_THIS)
- programmatically moveable cursors
*/
#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
#if !SDL_WINAPI_FAMILY_PHONE
// mouse->CreateCursor = WINRT_CreateCursor;
mouse->CreateSystemCursor = WINRT_CreateSystemCursor;
mouse->ShowCursor = WINRT_ShowCursor;

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL
#if defined(SDL_VIDEO_DRIVER_WINRT) && defined(SDL_VIDEO_OPENGL_EGL)
/* EGL implementation of SDL OpenGL support */
@ -144,7 +144,7 @@ WINRT_GLES_LoadLibrary(_THIS, const char *path)
return SDL_EGL_SetError("Could not retrieve ANGLE/WinRT display function(s)", "eglGetProcAddress");
}
#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
#if !SDL_WINAPI_FAMILY_PHONE
/* Try initializing EGL at D3D11 Feature Level 10_0+ (which is not
* supported on WinPhone 8.x.
*/

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -23,7 +23,7 @@
#ifndef SDL_winrtopengles_h_
#define SDL_winrtopengles_h_
#if SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL
#if defined(SDL_VIDEO_DRIVER_WINRT) && defined(SDL_VIDEO_OPENGL_EGL)
#include "../SDL_sysvideo.h"
#include "../SDL_egl_c.h"

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
/* SDL includes */
#include "SDL_winrtevents_c.h"
@ -78,7 +78,7 @@ WINRT_TransformCursorPosition(SDL_Window *window,
// Compute coordinates normalized from 0..1.
// If the coordinates need to be sized to the SDL window,
// we'll do that after.
#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8)
#if !SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION > NTDDI_WIN8)
outputPosition.X = rawPosition.X / nativeWindow->Bounds.Width;
outputPosition.Y = rawPosition.Y / nativeWindow->Bounds.Height;
#else
@ -116,7 +116,7 @@ SDL_bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt
{
using namespace Windows::UI::Input;
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#if SDL_WINAPI_FAMILY_PHONE
*button = SDL_BUTTON_LEFT;
return SDL_TRUE;
#else
@ -197,7 +197,7 @@ SDL_bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt
static bool WINRT_IsTouchEvent(Windows::UI::Input::PointerPoint ^ pointerPoint)
{
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#if SDL_WINAPI_FAMILY_PHONE
return true;
#else
using namespace Windows::Devices::Input;

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_DRIVER_WINRT
#ifdef SDL_VIDEO_DRIVER_WINRT
/* WinRT SDL video driver implementation
@ -29,10 +29,8 @@
*/
/* Standard C++11 includes */
#include <functional>
#include <string>
#include <sstream>
using namespace std;
#include <string>
/* Windows includes */
#include <agile.h>
@ -61,6 +59,7 @@ extern "C" {
#include "SDL_syswm.h"
#include "SDL_winrtopengles.h"
#include "../../core/windows/SDL_windows.h"
#include "SDL_winrtmessagebox.h"
}
#include "../../core/winrt/SDL_winrtapp_direct3d.h"
@ -116,13 +115,13 @@ static SDL_VideoDevice *WINRT_CreateDevice(void)
/* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice));
if (device == NULL) {
if (!device) {
SDL_OutOfMemory();
return 0;
}
data = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData));
if (data == NULL) {
if (!data) {
SDL_OutOfMemory();
SDL_free(device);
return 0;
@ -166,10 +165,10 @@ static SDL_VideoDevice *WINRT_CreateDevice(void)
return device;
}
#define WINRTVID_DRIVER_NAME "winrt"
VideoBootStrap WINRT_bootstrap = {
WINRTVID_DRIVER_NAME, "SDL WinRT video driver",
WINRT_CreateDevice
"winrt", "SDL WinRT video driver",
WINRT_CreateDevice,
WINRT_ShowMessageBox
};
static void SDLCALL WINRT_SetDisplayOrientationsPreference(void *userdata, const char *name, const char *oldValue, const char *newValue)
@ -182,7 +181,7 @@ static void SDLCALL WINRT_SetDisplayOrientationsPreference(void *userdata, const
*
* TODO, WinRT: consider reading in an app's .appxmanifest file, and apply its orientation when 'newValue == NULL'.
*/
if ((oldValue == NULL) && (newValue == NULL)) {
if ((!oldValue) && (!newValue)) {
return;
}
@ -322,7 +321,7 @@ static int WINRT_AddDisplaysForOutput(_THIS, IDXGIAdapter1 *dxgiAdapter1, int ou
WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::FindClosestMatchingMode failed", hr);
goto done;
} else {
displayName = WIN_StringToUTF8(dxgiOutputDesc.DeviceName);
displayName = WIN_StringToUTF8W(dxgiOutputDesc.DeviceName);
display.name = displayName;
WINRT_DXGIModeToSDLDisplayMode(&closestMatch, &display.desktop_mode);
display.current_mode = display.desktop_mode;
@ -337,7 +336,7 @@ static int WINRT_AddDisplaysForOutput(_THIS, IDXGIAdapter1 *dxgiAdapter1, int ou
}
dxgiModes = (DXGI_MODE_DESC *)SDL_calloc(numModes, sizeof(DXGI_MODE_DESC));
if (dxgiModes == NULL) {
if (!dxgiModes) {
SDL_OutOfMemory();
goto done;
}
@ -406,7 +405,7 @@ static int WINRT_AddDisplaysForAdapter(_THIS, IDXGIFactory2 *dxgiFactory2, int a
if (adapterIndex == 0 && outputIndex == 0) {
SDL_VideoDisplay display;
SDL_DisplayMode mode;
#if SDL_WINRT_USE_APPLICATIONVIEW
#ifdef SDL_WINRT_USE_APPLICATIONVIEW
ApplicationView ^ appView = ApplicationView::GetForCurrentView();
#endif
CoreWindow ^ coreWin = CoreWindow::GetForCurrentThread();
@ -421,7 +420,7 @@ static int WINRT_AddDisplaysForAdapter(_THIS, IDXGIFactory2 *dxgiFactory2, int a
failing test), whereas CoreWindow might not. -- DavidL
*/
#if (NTDDI_VERSION >= NTDDI_WIN10) || (SDL_WINRT_USE_APPLICATIONVIEW && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#if (NTDDI_VERSION >= NTDDI_WIN10) || (defined(SDL_WINRT_USE_APPLICATIONVIEW) && SDL_WINAPI_FAMILY_PHONE)
mode.w = WINRT_DIPS_TO_PHYSICAL_PIXELS(appView->VisibleBounds.Width);
mode.h = WINRT_DIPS_TO_PHYSICAL_PIXELS(appView->VisibleBounds.Height);
#else
@ -500,11 +499,11 @@ WINRT_DetectWindowFlags(SDL_Window *window)
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
bool is_fullscreen = false;
#if SDL_WINRT_USE_APPLICATIONVIEW
#ifdef SDL_WINRT_USE_APPLICATIONVIEW
if (data->appView) {
is_fullscreen = data->appView->IsFullScreenMode;
}
#elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION == NTDDI_WIN8)
#elif SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION == NTDDI_WIN8)
is_fullscreen = true;
#endif
@ -514,13 +513,13 @@ WINRT_DetectWindowFlags(SDL_Window *window)
int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width);
int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height);
#if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP) || (NTDDI_VERSION > NTDDI_WIN8)
#if !SDL_WINAPI_FAMILY_PHONE || (NTDDI_VERSION > NTDDI_WIN8)
// On all WinRT platforms, except for WinPhone 8.0, rotate the
// window size. This is needed to properly calculate
// fullscreen vs. maximized.
const DisplayOrientations currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation);
switch (currentOrientation) {
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
#if SDL_WINAPI_FAMILY_PHONE
case DisplayOrientations::Landscape:
case DisplayOrientations::LandscapeFlipped:
#else
@ -548,7 +547,7 @@ WINRT_DetectWindowFlags(SDL_Window *window)
latestFlags |= SDL_WINDOW_HIDDEN;
}
#if (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) && (NTDDI_VERSION < NTDDI_WINBLUE)
#if SDL_WINAPI_FAMILY_PHONE && (NTDDI_VERSION < NTDDI_WINBLUE)
// data->coreWindow->PointerPosition is not supported on WinPhone 8.0
latestFlags |= SDL_WINDOW_MOUSE_FOCUS;
#else
@ -622,7 +621,7 @@ int WINRT_CreateWindow(_THIS, SDL_Window *window)
*/
if (!WINRT_XAMLWasEnabled) {
data->coreWindow = CoreWindow::GetForCurrentThread();
#if SDL_WINRT_USE_APPLICATIONVIEW
#ifdef SDL_WINRT_USE_APPLICATIONVIEW
data->appView = ApplicationView::GetForCurrentView();
#endif
}
@ -630,7 +629,7 @@ int WINRT_CreateWindow(_THIS, SDL_Window *window)
/* Make note of the requested window flags, before they start getting changed. */
const Uint32 requestedFlags = window->flags;
#if SDL_VIDEO_OPENGL_EGL
#ifdef SDL_VIDEO_OPENGL_EGL
/* Setup the EGL surface, but only if OpenGL ES 2 was requested. */
if (!(window->flags & SDL_WINDOW_OPENGL)) {
/* OpenGL ES 2 wasn't requested. Don't set up an EGL surface. */
@ -685,7 +684,7 @@ int WINRT_CreateWindow(_THIS, SDL_Window *window)
SDL_WINDOW_BORDERLESS |
SDL_WINDOW_RESIZABLE;
#if SDL_VIDEO_OPENGL_EGL
#ifdef SDL_VIDEO_OPENGL_EGL
if (data->egl_surface) {
window->flags |= SDL_WINDOW_OPENGL;
}

View file

@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -99,7 +99,7 @@ struct SDL_WindowData
#ifdef SDL_VIDEO_OPENGL_EGL
EGLSurface egl_surface;
#endif
#if SDL_WINRT_USE_APPLICATIONVIEW
#ifdef SDL_WINRT_USE_APPLICATIONVIEW
Windows::UI::ViewManagement::ApplicationView ^ appView;
#endif
};