From 154452a72636ee7fd718c464e9d95860289db624 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 5 Sep 2024 23:36:16 -0400 Subject: [PATCH] winrt: Removed WinRT/Windows Phone/UWP support. Fixes #10724. --- .github/workflows/create-test-plan.py | 18 +- CMakeLists.txt | 146 +-- VisualC-WinRT/SDL-UWP.sln | 69 -- VisualC-WinRT/SDL-UWP.vcxproj | 932 ----------------- VisualC-WinRT/SDL-UWP.vcxproj.filters | 979 ------------------ .../Assets/LockScreenLogo.scale-200.png | Bin 1430 -> 0 bytes .../Assets/SplashScreen.scale-200.png | Bin 7700 -> 0 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 2937 -> 0 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 1647 -> 0 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 1255 -> 0 bytes VisualC-WinRT/testdraw/Assets/StoreLogo.png | Bin 1451 -> 0 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 3204 -> 0 bytes VisualC-WinRT/testdraw/Package.appxmanifest | 49 - VisualC-WinRT/testdraw/testdraw.vcxproj | 335 ------ .../testdraw/testdraw.vcxproj.filters | 85 -- build-scripts/SDL_migration.cocci | 10 - build-scripts/add-source-to-projects.pl | 1 - build-scripts/rename_macros.py | 2 +- cmake/test/CMakeLists.txt | 6 - docs/README-migration.md | 17 +- docs/README-porting.md | 2 +- docs/README-windows.md | 6 + docs/README-winrt.md | 483 --------- docs/README.md | 1 - examples/CMakeLists.txt | 63 +- include/SDL3/SDL_begin_code.h | 4 +- include/SDL3/SDL_filesystem.h | 26 +- include/SDL3/SDL_hints.h | 113 -- include/SDL3/SDL_main.h | 18 +- include/SDL3/SDL_main_impl.h | 64 -- include/SDL3/SDL_oldnames.h | 4 - include/SDL3/SDL_platform_defines.h | 2 +- include/SDL3/SDL_system.h | 84 -- include/SDL3/SDL_thread.h | 4 +- include/SDL3/SDL_video.h | 6 - include/build_config/SDL_build_config.h | 2 - include/build_config/SDL_build_config.h.cmake | 2 - .../build_config/SDL_build_config_windows.h | 2 - include/build_config/SDL_build_config_winrt.h | 229 ---- src/SDL.c | 4 +- src/SDL_log.c | 14 +- src/atomic/SDL_spinlock.c | 2 +- src/audio/wasapi/SDL_wasapi.c | 14 +- src/audio/wasapi/SDL_wasapi.h | 6 +- src/audio/wasapi/SDL_wasapi_win32.c | 13 +- src/audio/wasapi/SDL_wasapi_winrt.cpp | 360 ------- src/core/SDL_core_unsupported.c | 21 +- src/core/windows/SDL_hid.c | 8 +- src/core/windows/SDL_hid.h | 5 - src/core/windows/SDL_windows.c | 35 +- src/core/windows/SDL_windows.h | 2 - src/core/windows/SDL_xinput.c | 14 +- src/core/winrt/SDL_winrtapp_common.cpp | 43 - src/core/winrt/SDL_winrtapp_common.h | 31 - src/core/winrt/SDL_winrtapp_direct3d.cpp | 758 -------------- src/core/winrt/SDL_winrtapp_direct3d.h | 92 -- src/core/winrt/SDL_winrtapp_xaml.cpp | 146 --- src/core/winrt/SDL_winrtapp_xaml.h | 31 - src/cpuinfo/SDL_cpuinfo.c | 2 +- src/dynapi/SDL_dynapi.h | 2 - src/dynapi/SDL_dynapi.sym | 2 - src/dynapi/SDL_dynapi_overrides.h | 2 - src/dynapi/SDL_dynapi_procs.h | 2 - src/dynapi/SDL_dynapi_unsupported.h | 4 - src/file/SDL_iostream.c | 37 +- src/filesystem/winrt/SDL_sysfilesystem.cpp | 262 ----- src/gpu/d3d12/SDL_gpu_d3d12.c | 2 - src/joystick/SDL_joystick.c | 4 - src/joystick/windows/SDL_rawinputjoystick.c | 5 - .../windows/SDL_windows_gaming_input.c | 15 +- src/joystick/windows/SDL_windowsjoystick.c | 14 +- src/loadso/windows/SDL_sysloadso.c | 16 +- src/locale/winrt/SDL_syslocale.c | 54 - .../winrt/SDL3-WinRTResource_BlankCursor.cur | Bin 326 -> 0 bytes src/main/winrt/SDL3-WinRTResources.rc | 2 - src/main/winrt/SDL_sysmain_runapp.cpp | 45 - src/misc/winrt/SDL_sysurl.cpp | 38 - src/power/SDL_power.c | 3 - src/power/SDL_syspower.h | 1 - src/power/winrt/SDL_syspower.cpp | 39 - src/render/direct3d11/SDL_render_d3d11.c | 151 +-- src/render/direct3d11/SDL_render_winrt.cpp | 93 -- src/render/direct3d11/SDL_render_winrt.h | 36 - src/render/opengles2/SDL_render_gles2.c | 10 - src/thread/SDL_thread.c | 4 +- src/thread/SDL_thread_c.h | 2 - src/thread/stdcpp/SDL_syscond.cpp | 113 -- src/thread/stdcpp/SDL_sysmutex.cpp | 85 -- src/thread/stdcpp/SDL_sysmutex_c.h | 29 - src/thread/stdcpp/SDL_sysrwlock.cpp | 118 --- src/thread/stdcpp/SDL_systhread.cpp | 169 --- src/thread/stdcpp/SDL_systhread_c.h | 24 - src/thread/windows/SDL_syscond_cv.c | 14 - src/thread/windows/SDL_sysmutex.c | 16 - src/thread/windows/SDL_sysrwlock_srw.c | 23 +- src/thread/windows/SDL_syssem.c | 20 - src/thread/windows/SDL_systhread.c | 2 - src/thread/windows/SDL_systls.c | 12 - src/time/windows/SDL_systime.c | 4 - src/timer/SDL_timer.c | 3 +- src/timer/windows/SDL_systimer.c | 12 +- src/video/SDL_egl.c | 10 +- src/video/SDL_stretch.c | 2 +- src/video/SDL_sysvideo.h | 1 - src/video/SDL_video.c | 50 - src/video/windows/SDL_windowsmodes.c | 4 - src/video/winrt/SDL_winrtevents.cpp | 143 --- src/video/winrt/SDL_winrtevents_c.h | 80 -- src/video/winrt/SDL_winrtgamebar.cpp | 185 ---- src/video/winrt/SDL_winrtgamebar_cpp.h | 33 - src/video/winrt/SDL_winrtkeyboard.cpp | 199 ---- src/video/winrt/SDL_winrtmessagebox.cpp | 112 -- src/video/winrt/SDL_winrtmessagebox.h | 27 - src/video/winrt/SDL_winrtmouse.cpp | 255 ----- src/video/winrt/SDL_winrtmouse_c.h | 38 - src/video/winrt/SDL_winrtopengles.cpp | 207 ---- src/video/winrt/SDL_winrtopengles.h | 67 -- src/video/winrt/SDL_winrtpointerinput.cpp | 389 ------- src/video/winrt/SDL_winrtvideo.cpp | 846 --------------- src/video/winrt/SDL_winrtvideo_cpp.h | 106 -- test/CMakeLists.txt | 72 +- test/uwp/Package.appxmanifest.in | 52 - test/uwp/logo-50x50.png | Bin 2421 -> 0 bytes test/uwp/splash-620x300.png | Bin 30918 -> 0 bytes test/uwp/square-150x150.png | Bin 10605 -> 0 bytes test/uwp/square-44x44.png | Bin 2082 -> 0 bytes 126 files changed, 150 insertions(+), 9582 deletions(-) delete mode 100644 VisualC-WinRT/SDL-UWP.sln delete mode 100644 VisualC-WinRT/SDL-UWP.vcxproj delete mode 100644 VisualC-WinRT/SDL-UWP.vcxproj.filters delete mode 100644 VisualC-WinRT/testdraw/Assets/LockScreenLogo.scale-200.png delete mode 100644 VisualC-WinRT/testdraw/Assets/SplashScreen.scale-200.png delete mode 100644 VisualC-WinRT/testdraw/Assets/Square150x150Logo.scale-200.png delete mode 100644 VisualC-WinRT/testdraw/Assets/Square44x44Logo.scale-200.png delete mode 100644 VisualC-WinRT/testdraw/Assets/Square44x44Logo.targetsize-24_altform-unplated.png delete mode 100644 VisualC-WinRT/testdraw/Assets/StoreLogo.png delete mode 100644 VisualC-WinRT/testdraw/Assets/Wide310x150Logo.scale-200.png delete mode 100644 VisualC-WinRT/testdraw/Package.appxmanifest delete mode 100644 VisualC-WinRT/testdraw/testdraw.vcxproj delete mode 100644 VisualC-WinRT/testdraw/testdraw.vcxproj.filters delete mode 100644 docs/README-winrt.md delete mode 100644 include/build_config/SDL_build_config_winrt.h delete mode 100644 src/audio/wasapi/SDL_wasapi_winrt.cpp delete mode 100644 src/core/winrt/SDL_winrtapp_common.cpp delete mode 100644 src/core/winrt/SDL_winrtapp_common.h delete mode 100644 src/core/winrt/SDL_winrtapp_direct3d.cpp delete mode 100644 src/core/winrt/SDL_winrtapp_direct3d.h delete mode 100644 src/core/winrt/SDL_winrtapp_xaml.cpp delete mode 100644 src/core/winrt/SDL_winrtapp_xaml.h delete mode 100644 src/filesystem/winrt/SDL_sysfilesystem.cpp delete mode 100644 src/locale/winrt/SDL_syslocale.c delete mode 100644 src/main/winrt/SDL3-WinRTResource_BlankCursor.cur delete mode 100644 src/main/winrt/SDL3-WinRTResources.rc delete mode 100644 src/main/winrt/SDL_sysmain_runapp.cpp delete mode 100644 src/misc/winrt/SDL_sysurl.cpp delete mode 100644 src/power/winrt/SDL_syspower.cpp delete mode 100644 src/render/direct3d11/SDL_render_winrt.cpp delete mode 100644 src/render/direct3d11/SDL_render_winrt.h delete mode 100644 src/thread/stdcpp/SDL_syscond.cpp delete mode 100644 src/thread/stdcpp/SDL_sysmutex.cpp delete mode 100644 src/thread/stdcpp/SDL_sysmutex_c.h delete mode 100644 src/thread/stdcpp/SDL_sysrwlock.cpp delete mode 100644 src/thread/stdcpp/SDL_systhread.cpp delete mode 100644 src/thread/stdcpp/SDL_systhread_c.h delete mode 100644 src/video/winrt/SDL_winrtevents.cpp delete mode 100644 src/video/winrt/SDL_winrtevents_c.h delete mode 100644 src/video/winrt/SDL_winrtgamebar.cpp delete mode 100644 src/video/winrt/SDL_winrtgamebar_cpp.h delete mode 100644 src/video/winrt/SDL_winrtkeyboard.cpp delete mode 100644 src/video/winrt/SDL_winrtmessagebox.cpp delete mode 100644 src/video/winrt/SDL_winrtmessagebox.h delete mode 100644 src/video/winrt/SDL_winrtmouse.cpp delete mode 100644 src/video/winrt/SDL_winrtmouse_c.h delete mode 100644 src/video/winrt/SDL_winrtopengles.cpp delete mode 100644 src/video/winrt/SDL_winrtopengles.h delete mode 100644 src/video/winrt/SDL_winrtpointerinput.cpp delete mode 100644 src/video/winrt/SDL_winrtvideo.cpp delete mode 100644 src/video/winrt/SDL_winrtvideo_cpp.h delete mode 100644 test/uwp/Package.appxmanifest.in delete mode 100644 test/uwp/logo-50x50.png delete mode 100644 test/uwp/splash-620x300.png delete mode 100644 test/uwp/square-150x150.png delete mode 100644 test/uwp/square-44x44.png diff --git a/.github/workflows/create-test-plan.py b/.github/workflows/create-test-plan.py index 522ea54ab..4751383b3 100755 --- a/.github/workflows/create-test-plan.py +++ b/.github/workflows/create-test-plan.py @@ -95,7 +95,6 @@ class JobSpec: msvc_project: Optional[str] = None msvc_arch: Optional[MsvcArch] = None clang_cl: bool = False - uwp: bool = False gdk: bool = False vita_gles: Optional[VitaGLES] = None @@ -112,7 +111,6 @@ JOB_SPECS = { "msvc-clang-x86": JobSpec(name="Windows (MSVC, clang-cl x86)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-clang-cl-x86", msvc_arch=MsvcArch.X86, clang_cl=True, ), "msvc-arm32": JobSpec(name="Windows (MSVC, ARM)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm32", msvc_arch=MsvcArch.Arm32, ), "msvc-arm64": JobSpec(name="Windows (MSVC, ARM64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-arm64", msvc_arch=MsvcArch.Arm64, ), - "msvc-uwp-x64": JobSpec(name="UWP (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-UWP", msvc_arch=MsvcArch.X64, msvc_project="VisualC-WinRT/SDL-UWP.sln", uwp=True, ), "msvc-gdk-x64": JobSpec(name="GDK (MSVC, x64)", os=JobOs.WindowsLatest, platform=SdlPlatform.Msvc, artifact="SDL-VC-GDK", msvc_arch=MsvcArch.X64, msvc_project="VisualC-GDK/SDL.sln", gdk=True, no_cmake=True, ), "ubuntu-20.04": JobSpec(name="Ubuntu 20.04", os=JobOs.Ubuntu20_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu20.04", ), "ubuntu-22.04": JobSpec(name="Ubuntu 22.04", os=JobOs.Ubuntu22_04, platform=SdlPlatform.Linux, artifact="SDL-ubuntu22.04", ), @@ -358,10 +356,9 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta "-DCMAKE_EXE_LINKER_FLAGS=-DEBUG", "-DCMAKE_SHARED_LINKER_FLAGS=-DEBUG", )) - if spec.uwp: - job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$:Debug>DLL'") - else: - job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$:Debug>'") + + job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$:Debug>'") + if spec.clang_cl: job.cmake_arguments.extend(( "-DCMAKE_C_COMPILER=clang-cl", @@ -398,14 +395,7 @@ def spec_to_job(spec: JobSpec, key: str, trackmem_symbol_names: bool) -> JobDeta case MsvcArch.Arm64: job.msvc_vcvars = "x64_arm64" job.run_tests = False - if spec.uwp: - job.build_tests = False - job.cmake_arguments.extend(( - "-DCMAKE_SYSTEM_NAME=WindowsStore", - "-DCMAKE_SYSTEM_VERSION=10.0", - )) - job.msvc_project_flags.append("-p:WindowsTargetPlatformVersion=10.0.17763.0") - elif spec.gdk: + if spec.gdk: job.setup_gdk_folder = "VisualC-GDK" else: match spec.msvc_arch: diff --git a/CMakeLists.txt b/CMakeLists.txt index 5716da4ce..9660786a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,7 +361,7 @@ cmake_dependent_option(SDL_STATIC "Build a static version of the library" ${SDL_ option(SDL_TEST_LIBRARY "Build the SDL3_test library" ON) dep_option(SDL_TESTS "Build the test directory" OFF SDL_TEST_LIBRARY OFF) -dep_option(SDL_INSTALL_TESTS "Install test-cases" OFF "NOT SDL_DISABLE_INSTALL;NOT SDL_FRAMEWORK;NOT WINDOWS_STORE" OFF) +dep_option(SDL_INSTALL_TESTS "Install test-cases" OFF "NOT SDL_DISABLE_INSTALL;NOT SDL_FRAMEWORK" OFF) dep_option(SDL_TESTS_LINK_SHARED "link tests to shared SDL library" "${SDL_SHARED}" "SDL_SHARED;SDL_STATIC" "${SDL_SHARED}") set(SDL_TESTS_TIMEOUT_MULTIPLIER "1" CACHE STRING "Timeout multiplier to account for really slow machines") @@ -428,11 +428,6 @@ if (LIBC_IS_GLIBC AND CMAKE_SIZEOF_VOID_P EQUAL 4) sdl_compile_definitions(PRIVATE "_TIME_BITS=64") endif() -if(WINDOWS_STORE) - sdl_compile_definitions(PRIVATE "SDL_BUILDING_WINRT=1" "WINAPI_FAMILY=WINAPI_FAMILY_APP") - sdl_compile_options(PRIVATE "$<$:/ZW>" "$<$:-EHsc>") -endif() - check_linker_supports_version_file(HAVE_WL_VERSION_SCRIPT) if(HAVE_WL_VERSION_SCRIPT) sdl_shared_link_options("-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/dynapi/SDL_dynapi.sym") @@ -1833,15 +1828,6 @@ elseif(WINDOWS) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/windows/*.c") sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/windows/*.c") - if(WINDOWS_STORE) - enable_language(CXX) - sdl_glob_sources( - "${SDL3_SOURCE_DIR}/src/core/winrt/*.c" - "${SDL3_SOURCE_DIR}/src/core/winrt/*.cpp" - "${SDL3_SOURCE_DIR}/src/main/winrt/*.cpp" - ) - endif() - if(TARGET SDL3-shared AND MSVC AND NOT SDL_LIBC) # Prevent codegen that would use the VC runtime libraries. target_compile_options(SDL3-shared PRIVATE $<$:/GS-> $<$:/Gs1048576>) @@ -1850,11 +1836,8 @@ elseif(WINDOWS) endif() endif() - if(WINDOWS_STORE) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/misc/winrt/*.cpp") - else() - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/misc/windows/*.c") - endif() + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/misc/windows/*.c") + set(HAVE_SDL_MISC TRUE) # Check for DirectX @@ -1875,7 +1858,7 @@ elseif(WINDOWS) check_include_file(ddraw.h HAVE_DDRAW_H) check_include_file(dsound.h HAVE_DSOUND_H) check_include_file(dinput.h HAVE_DINPUT_H) - if(WINDOWS_STORE OR SDL_CPU_ARM32) + if(SDL_CPU_ARM32) # !!! FIXME: this should probably check if we're !(x86 or x86-64) instead of arm. set(HAVE_DINPUT_H 0) endif() check_include_file(dxgi.h HAVE_DXGI_H) @@ -1932,7 +1915,7 @@ elseif(WINDOWS) ) if(SDL_AUDIO) - if(HAVE_DSOUND_H AND NOT WINDOWS_STORE) + if(HAVE_DSOUND_H) set(SDL_AUDIO_DRIVER_DSOUND 1) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/directsound/*.c") set(HAVE_SDL_AUDIO TRUE) @@ -1942,27 +1925,15 @@ elseif(WINDOWS) set(SDL_AUDIO_DRIVER_WASAPI 1) set(HAVE_WASAPI TRUE) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/audio/wasapi/*.c") - if(WINDOWS_STORE) - sdl_sources("${SDL3_SOURCE_DIR}/src/audio/wasapi/SDL_wasapi_winrt.cpp") - endif() set(HAVE_SDL_AUDIO TRUE) endif() endif() if(SDL_VIDEO) - if(WINDOWS_STORE) - set(SDL_VIDEO_DRIVER_WINRT 1) - sdl_glob_sources( - "${SDL3_SOURCE_DIR}/src/video/winrt/*.c" - "${SDL3_SOURCE_DIR}/src/video/winrt/*.cpp" - "${SDL3_SOURCE_DIR}/src/render/direct3d11/*.cpp" - ) - else() - set(SDL_VIDEO_DRIVER_WINDOWS 1) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/windows/*.c") - endif() + set(SDL_VIDEO_DRIVER_WINDOWS 1) + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/windows/*.c") - if(SDL_RENDER_D3D AND HAVE_D3D9_H AND NOT WINDOWS_STORE) + if(SDL_RENDER_D3D AND HAVE_D3D9_H) set(SDL_VIDEO_RENDER_D3D 1) set(HAVE_RENDER_D3D TRUE) endif() @@ -1970,7 +1941,7 @@ elseif(WINDOWS) set(SDL_VIDEO_RENDER_D3D11 1) set(HAVE_RENDER_D3D11 TRUE) endif() - if(SDL_RENDER_D3D12 AND NOT WINDOWS_STORE) + if(SDL_RENDER_D3D12) set(SDL_VIDEO_RENDER_D3D12 1) set(HAVE_RENDER_D3D12 TRUE) endif() @@ -1980,60 +1951,36 @@ elseif(WINDOWS) set(SDL_THREAD_GENERIC_COND_SUFFIX 1) set(SDL_THREAD_GENERIC_RWLOCK_SUFFIX 1) set(SDL_THREAD_WINDOWS 1) - if(WINDOWS_STORE) - sdl_sources( - "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_syscond.cpp" - "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_sysmutex.cpp" - "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_sysrwlock.cpp" - "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_systhread.cpp" - "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syssem.c" - ) - else() - sdl_sources( - "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c" - "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syscond_cv.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysrwlock_srw.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syssem.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systhread.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systls.c" - ) - endif() + sdl_sources( + "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c" + "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syscond_cv.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysrwlock_srw.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syssem.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systhread.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systls.c" + ) set(HAVE_SDL_THREADS TRUE) - if(SDL_SENSOR AND HAVE_SENSORSAPI_H AND NOT WINDOWS_STORE) + if(SDL_SENSOR AND HAVE_SENSORSAPI_H) set(SDL_SENSOR_WINDOWS 1) set(HAVE_SDL_SENSORS TRUE) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/sensor/windows/*.c") endif() if(SDL_POWER) - if(WINDOWS_STORE) - set(SDL_POWER_WINRT 1) - sdl_sources("${SDL3_SOURCE_DIR}/src/power/winrt/SDL_syspower.cpp") - else() - set(SDL_POWER_WINDOWS 1) - sdl_sources("${SDL3_SOURCE_DIR}/src/power/windows/SDL_syspower.c") - set(HAVE_SDL_POWER TRUE) - endif() + set(SDL_POWER_WINDOWS 1) + sdl_sources("${SDL3_SOURCE_DIR}/src/power/windows/SDL_syspower.c") + set(HAVE_SDL_POWER TRUE) endif() - if(WINDOWS_STORE) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/locale/winrt/*.c") - else() - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/locale/windows/*.c") - endif() + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/locale/windows/*.c") set(HAVE_SDL_LOCALE TRUE) set(SDL_FILESYSTEM_WINDOWS 1) - if(WINDOWS_STORE) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/winrt/*.cpp") - sdl_sources("${SDL3_SOURCE_DIR}/src/filesystem/windows/SDL_sysfsops.c") - else() - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/windows/*.c") - endif() + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/filesystem/windows/*.c") set(HAVE_SDL_FILESYSTEM TRUE) set(SDL_FSOPS_WINDOWS 1) @@ -2041,27 +1988,12 @@ elseif(WINDOWS) set(SDL_STORAGE_GENERIC 1) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/storage/generic/*.c") - if(NOT WINDOWS_STORE) - set(SDL_STORAGE_STEAM 1) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/storage/steam/*.c") - endif() + set(SDL_STORAGE_STEAM 1) + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/storage/steam/*.c") set(HAVE_SDL_STORAGE 1) # Libraries for Win32 native and MinGW - if(NOT WINDOWS_STORE) - sdl_link_dependency(base LIBS kernel32 user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32) - endif() - - if(WINDOWS_STORE) - sdl_link_dependency(windows - LIBS - vccorlib$<$:d>.lib - msvcrt$<$:d>.lib - LINK_OPTIONS - /nodefaultlib:vccorlib$<$:d> - /nodefaultlib:msvcrt$<$:d> - ) - endif() + sdl_link_dependency(base LIBS kernel32 user32 gdi32 winmm imm32 ole32 oleaut32 version uuid advapi32 setupapi shell32) set(SDL_TIME_WINDOWS 1) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/time/windows/*.c") @@ -2078,7 +2010,7 @@ elseif(WINDOWS) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/windows/*.c") if(SDL_VIDEO) - if(SDL_OPENGL AND NOT WINDOWS_STORE) + if(SDL_OPENGL) set(SDL_VIDEO_OPENGL 1) set(SDL_VIDEO_OPENGL_WGL 1) set(SDL_VIDEO_RENDER_OGL 1) @@ -2109,18 +2041,14 @@ elseif(WINDOWS) if(SDL_JOYSTICK) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/joystick/windows/*.c") - if(NOT WINDOWS_STORE) - set(SDL_JOYSTICK_RAWINPUT 1) - endif() + set(SDL_JOYSTICK_RAWINPUT 1) if(HAVE_DINPUT_H) set(SDL_JOYSTICK_DINPUT 1) sdl_link_dependency(joystick LIBS dinput8) endif() if(HAVE_XINPUT_H) - if(NOT WINDOWS_STORE) - set(SDL_JOYSTICK_XINPUT 1) - set(HAVE_XINPUT TRUE) - endif() + set(SDL_JOYSTICK_XINPUT 1) + set(HAVE_XINPUT TRUE) endif() if(HAVE_WINDOWS_GAMING_INPUT_H) set(SDL_JOYSTICK_WGI 1) @@ -2132,7 +2060,7 @@ elseif(WINDOWS) set(HAVE_SDL_JOYSTICK TRUE) if(SDL_HAPTIC) - if(HAVE_DINPUT_H AND NOT WINDOWS_STORE) + if(HAVE_DINPUT_H) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/haptic/windows/*.c") set(SDL_HAPTIC_DINPUT 1) set(HAVE_SDL_HAPTIC TRUE) @@ -2141,7 +2069,7 @@ elseif(WINDOWS) endif() if(SDL_CAMERA) - if(HAVE_MFAPI_H AND NOT WINDOWS_STORE) + if(HAVE_MFAPI_H) set(HAVE_CAMERA TRUE) set(SDL_CAMERA_DRIVER_MEDIAFOUNDATION 1) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/camera/mediafoundation/*.c") @@ -2922,7 +2850,7 @@ if (SDL_DIALOG) elseif(HAIKU) sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/haiku/SDL_haikudialog.cc) set(HAVE_SDL_DIALOG TRUE) - elseif(WINDOWS AND NOT WINDOWS_STORE) + elseif(WINDOWS) sdl_sources(${SDL3_SOURCE_DIR}/src/dialog/windows/SDL_windowsdialog.c) set(HAVE_SDL_DIALOG TRUE) elseif(MACOS) @@ -2943,7 +2871,7 @@ if(SDL_VIDEO) endif() endif() -if(SDL_GPU AND NOT WINDOWS_STORE) +if(SDL_GPU) if(HAVE_D3D11_H) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/gpu/d3d11/*.c") set(SDL_GPU_D3D11 1) @@ -3316,7 +3244,7 @@ if(SDL_SHARED) ) endif() if(NOT SDL_LIBC) - if(MSVC AND (NOT MSVC_CLANG AND NOT WINDOWS_STORE)) + if(MSVC AND NOT MSVC_CLANG) # Don't try to link with the default set of libraries. # Note: The clang toolset for Visual Studio does not support /NODEFAULTLIB. target_link_options(SDL3-shared PRIVATE "/NODEFAULTLIB") diff --git a/VisualC-WinRT/SDL-UWP.sln b/VisualC-WinRT/SDL-UWP.sln deleted file mode 100644 index 86bd92dea..000000000 --- a/VisualC-WinRT/SDL-UWP.sln +++ /dev/null @@ -1,69 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.33027.164 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL3-UWP", "SDL-UWP.vcxproj", "{89E9B32E-A86A-47C3-A948-D2B1622925CE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdraw", "testdraw\testdraw.vcxproj", "{95943BBE-F378-4068-A3FD-DAE1B8309B6E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|ARM64 = Debug|ARM64 - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM = Release|ARM - Release|ARM64 = Release|ARM64 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.ActiveCfg = Debug|ARM - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM.Build.0 = Debug|ARM - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|ARM64.Build.0 = Debug|ARM64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.ActiveCfg = Debug|x64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x64.Build.0 = Debug|x64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.ActiveCfg = Debug|Win32 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Debug|x86.Build.0 = Debug|Win32 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.ActiveCfg = Release|ARM - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM.Build.0 = Release|ARM - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM64.ActiveCfg = Release|ARM64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|ARM64.Build.0 = Release|ARM64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.ActiveCfg = Release|x64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x64.Build.0 = Release|x64 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.ActiveCfg = Release|Win32 - {89E9B32E-A86A-47C3-A948-D2B1622925CE}.Release|x86.Build.0 = Release|Win32 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|ARM.ActiveCfg = Debug|ARM - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|ARM.Build.0 = Debug|ARM - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|ARM.Deploy.0 = Debug|ARM - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|ARM64.Build.0 = Debug|ARM64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|x64.ActiveCfg = Debug|x64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|x64.Build.0 = Debug|x64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|x64.Deploy.0 = Debug|x64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|x86.ActiveCfg = Debug|Win32 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|x86.Build.0 = Debug|Win32 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Debug|x86.Deploy.0 = Debug|Win32 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|ARM.ActiveCfg = Release|ARM - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|ARM.Build.0 = Release|ARM - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|ARM.Deploy.0 = Release|ARM - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|ARM64.ActiveCfg = Release|ARM64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|ARM64.Build.0 = Release|ARM64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|ARM64.Deploy.0 = Release|ARM64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|x64.ActiveCfg = Release|x64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|x64.Build.0 = Release|x64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|x64.Deploy.0 = Release|x64 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|x86.ActiveCfg = Release|Win32 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|x86.Build.0 = Release|Win32 - {95943BBE-F378-4068-A3FD-DAE1B8309B6E}.Release|x86.Deploy.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {30680F51-7BB9-41D0-A0D6-BC44A1557D87} - EndGlobalSection -EndGlobal diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj deleted file mode 100644 index a71477150..000000000 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ /dev/null @@ -1,932 +0,0 @@ - - - - - Debug - ARM64 - - - Debug - ARM - - - Debug - Win32 - - - Debug - x64 - - - Release - ARM - - - Release - ARM64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - Create - Create - Create - Create - Create - Create - Create - Create - - - Create - $(IntDir)$(TargetName)_cpp.pch - Create - $(IntDir)$(TargetName)_cpp.pch - Create - $(IntDir)$(TargetName)_cpp.pch - Create - $(IntDir)$(TargetName)_cpp.pch - Create - $(IntDir)$(TargetName)_cpp.pch - Create - $(IntDir)$(TargetName)_cpp.pch - Create - $(IntDir)$(TargetName)_cpp.pch - Create - $(IntDir)$(TargetName)_cpp.pch - true - true - true - true - true - true - true - true - - - - - - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - - - - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - true - true - true - true - true - true - true - true - - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - NotUsing - - - - - - - - - - - - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - true - true - true - true - true - true - true - true - - - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - true - true - true - true - true - true - true - true - - - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - true - true - true - true - true - true - true - true - - - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - true - true - true - true - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - true - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - $(IntDir)$(TargetName)_cpp.pch - - - - - - - {89e9b32e-a86a-47c3-a948-d2b1622925ce} - DynamicLibrary - SDL3-UWP - SDL3 - en-US - 14.0 - true - Windows Store - 8.2 - 10.0.16299.0 - 10.0.16299.0 - 10.0 - - - - DynamicLibrary - true - v142 - - - DynamicLibrary - true - v142 - - - DynamicLibrary - true - v142 - - - DynamicLibrary - true - v142 - - - DynamicLibrary - false - true - v142 - - - DynamicLibrary - false - true - v142 - - - DynamicLibrary - false - true - v142 - - - DynamicLibrary - false - true - v142 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - false - false - SDL3 - $(SolutionDir)/../src;$(IncludePath) - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - - - Use - false - $(ProjectDir)\..\include;$(ProjectDir)\..\include\build_config;%(AdditionalIncludeDirectories) - DLL_EXPORT;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions) - SDL_internal.h - - - Console - false - false - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - - - $(TreatWarningsAsError) - - - - - - - diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters deleted file mode 100644 index e57ee7174..000000000 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ /dev/null @@ -1,979 +0,0 @@ - - - - - {fa0ff2df-c3d6-498a-96f1-1f88e7ce0da3} - - - {68e1b30b-19ed-4612-93e4-6260c5a979e5} - - - {00004a2523fc69c7128c60648c860000} - - - {0000318d975e0a2867ab1d5727bf0000} - - - {00009e5236c2ac679fe0bc30beb90000} - - - {000031d805439b865ff4550d2f620000} - - - {00004389761f0ae646deb5a3d65f0000} - - - {0000bc587ef6c558d75ce2e620cb0000} - - - {0000948771d0040a6a55997a7f1e0000} - - - {0000012051ca8361c8e1013aee1d0000} - - - {0000c99bfadbbcb05a474a8472910000} - - - {00006680a11742e2b280c6453be80000} - - - - - Header Files - - - API Headers - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - camera - - - camera - - - filesystem - - - Header Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - main - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - camera\dummy - - - camera - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - dialog - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - filesystem - - - filesystem\windows - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - main\generic - - - main - - - Source Files - - - main\winrt - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - time - - - time\windows - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Header Files - - - - - - Source Files - - - Source Files - - - Source Files - - - stdlib - - - Source Files - - - Source Files - - - diff --git a/VisualC-WinRT/testdraw/Assets/LockScreenLogo.scale-200.png b/VisualC-WinRT/testdraw/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 735f57adb5dfc01886d137b4e493d7e97cf13af3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1430 zcmaJ>TTC2P7~aKltDttVHYH6u8Io4i*}3fO&d$gd*bA_<3j~&e7%8(eXJLfhS!M@! zKrliY>>6yT4+Kr95$!DoD(Qn-5TP|{V_KS`k~E6(LGS@#`v$hQo&^^BKsw3HIsZBT z_y6C2n`lK@apunKojRQ^(_P}Mgewt$(^BBKCTZ;*xa?J3wQ7~@S0lUvbcLeq1Bg4o zH-bvQi|wt~L7q$~a-gDFP!{&TQfc3fX*6=uHv* zT&1&U(-)L%Xp^djI2?~eBF2cxC@YOP$+9d?P&h?lPy-9M2UT9fg5jKm1t$m#iWE{M zIf%q9@;fyT?0UP>tcw-bLkz;s2LlKl2qeP0w zECS7Ate+Awk|KQ+DOk;fl}Xsy4o^CY=pwq%QAAKKl628_yNPsK>?A>%D8fQG6IgdJ ztnxttBz#NI_a@fk7SU`WtrpsfZsNs9^0(2a z@C3#YO3>k~w7?2hipBf{#b6`}Xw1hlG$yi?;1dDs7k~xDAw@jiI*+tc;t2Lflg&bM)0!Y;0_@=w%`LW^8DsYpS#-bLOklX9r?Ei}TScw|4DbpW%+7 zFgAI)f51s}{y-eWb|vrU-Ya!GuYKP)J7z#*V_k^Xo>4!1Yqj*m)x&0L^tg3GJbVAJ zJ-Pl$R=NAabouV=^z_t;^K*0AvFs!vYU>_<|I^#c?>>CR<(T?=%{;U=aI*SbZADLH z&(f2wz_Y0??Tf|g;?|1Znw6}6U43Q#qNRwv1vp9uFn1)V#*4p&%$mP9x&15^OaBiDS(XppT|z^>;B{PLVEbS3IFYV yGvCsSX*m diff --git a/VisualC-WinRT/testdraw/Assets/SplashScreen.scale-200.png b/VisualC-WinRT/testdraw/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 023e7f1feda78d5100569825acedfd213a0d84e9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7700 zcmeHLYj~4Yw%(;oxoEH#Kxq-eR|+VkP17b#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+FNEQD5Yd<~yX7k_l h&G-K)@HZb3BABY{)U1?^%I#E6`MGoTtustd{~yM6srvu` diff --git a/VisualC-WinRT/testdraw/Assets/Square150x150Logo.scale-200.png b/VisualC-WinRT/testdraw/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index af49fec1a5484db1d52a7f9b5ec90a27c7030186..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2937 zcma)84OCO-8BSud5)jwMLRVKgX(S?$n?Ld|vrsm<$CF7)&zTbyy1FE5bU`Q17MRv`9ue$;R(@8kR;#vJ*IM0>cJIAOte!d7oRgdH zd%ySjdB6L9=gX^A6)VzH7p2l@v~3zJAMw|DFy#^)F@@F*`mqUn=Il>l)8_+ab;nOW{%+iPx z+s{Eu|&pIs)Z7{La9~?xKfyl z#43?gjEL15d4WbOZo#SiP%>DB^+BcnJ=7dHEe;r#G=tuw|ka z%q@}##Uh7;tc%L_64m(kHtw74ty%BJMb)_1)#S0j`)F8_1jF7vScpsnH=0V19bO8y zR`0SjIdCUo&=>JwMQF8KHA<{ODHTiQh}0^@5QRmCA?gOH6_H3K^-_sNB^RrdNuK-R zOO*vOrKCVvDwgUck`kF(E7j{I#iiN;b*ZdCt4m@HPA`EuEqGGf4%!K<;(=I=&Vyrw z%TwcWtxa}8mCZ%Cyf&ActJ6_$ox5z6-D!0-dvnRx6t7y3d+h6QYpKWO;8OdnvERo7 zuEf>ih5`wqY)~o@OeVt-wM?Q!>QzdGRj!bz6fzYrfw$hZfAKzr2-M+D+R>}~oT574c;_3zquHcElqKIsryILt3g8n3jcMb+j?i?-L3FpZJ z2WRVBRdDPc+G5aaYg#5hpE+6nQ|(VSoxT3|biF;BUq#==-27Xi=gihDPYP$7?=9cP zYKE$jeQ|3~_L0VG-(F~2ZPyD0=k{J4Q~h(t__{-mz_w8{JDY9{`1ouzz!Vr5!ECdE z6U~O1k8c}24V7~zzXWTV-Pe4)y}wQJS&q%H5`Fo_f_JvIU489aCX$;P`u#!I-=^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2{w{1$}Sz4zGn3Du&x bht0Iza^2ykEt4(epJ78uh5nDlX8(TxzDYwP diff --git a/VisualC-WinRT/testdraw/Assets/Square44x44Logo.scale-200.png b/VisualC-WinRT/testdraw/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index ce342a2ec8a61291ba76c54604aea7e9d20af11b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1647 zcmaJ?eM}Q)7(e+G1Q(|`V9JhTI2>MkceK4;p;PR&$Pi?ejk3YQ_3o`S&|W_dsOZ8# zWPTt69g`t$ab`0cj-Y0yiBSOqmd)tG7G(}M5aP0_%&9TijB#&)I{zSE^4@#z^FF`l z`8{8`o%wlL(UI|y2!cdsuVamHH~H86F!*-15em4)NqUpCQM5?aoC_eCf@lV4wvF2a zjDQn1JBL69f&@2M3rvzJcfE!eZ8FZUBlFlC5RD)it33{mF9#B82AiyQE%w)`vlwa> zv{<1sm&kSKK$&%2jSFn7$t&P%%6Ue>R=EAnG8N7fqynWG8L3p!4801a;8{+nliO(qd(jNJ_?+9W3#hLIDLoT6~3fx9=`CC-D}-AMrpEO7HK zt3$GicGPc?GmDjy7K2P@La;eu4!$zWCZ`ym{Z$b zu-O6RM&K4JT|BIZB`E-gxqG%FzanI#+2FFmqHqXG7yxWB=w55RGOM)$xMb(>kSNR z2w=1AZi%z=AmG~yea~XaXJR!v7vLn(RUnELfiB1|6D84ICOS}^Zo2AdN}<&*h}G_u z{xZ!(%>tLT3J3<5XhWy-tg+6)0nmUUENLW8TWA{R6bgVd3X;anYFZ^IRis*_P-C-r z;i>%1^eL3UI2-{w8nuFFcs0e~7J{O2k^~Ce%+Ly4U?|=!0LH=t6()xi<^I-rs+9sF z*q{E-CxZbGPeu#a;XJwE;9S1?#R&uns>^0G3p`hEUF*v`M?@h%T%J%RChmD|EVydq zmHWh*_=S%emRC*mhxaVLzT@>Z2SX0u9v*DIJ@WC^kLVdlGV6LpK$KIrlJqc zpJ921)+3JJdTx|<`G&kXpKkjGJv=76R`yYIQ{#c-`%+`#V(7}Q;&@6U8!Td1`d;?N z_9mnI#?AA}4J!r)LN4!E-@H5eXauuB7TOawS>Y|{-P?NNx-lq+z1W-+y(;39P&&LP zL{N80?&=C*qKmdA^moMZRuPcD!B<*mq$ch=0Cnlitw#txRWhb3%TQvPqjkC`F69G4b! ze7z9MZ#+;_#l?H37UqUhDFb^l&s2{oM$3I0o^Q!yx;;V)QmCMo)Tb_ui|mit8MS?U zm##6$sZZ1$@|s%?l@>4Z<*Q}sRBSKMhb4I{e5LdEhsHIHTe8Bod5c>6QtT>$XgUBz z6MK`kO$=jmt@FqggOhJ5j~e@ygRbG;<{Vu)*+nn9aQeo0;$#j;|MS=S$&L?BeV25z xs3B`@=#`5TF{^6(A1rvdY@|-RtQ|iS5{tyX+wH?;n8E)G$kykv-D^wh{{!TZT%7;_ diff --git a/VisualC-WinRT/testdraw/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/VisualC-WinRT/testdraw/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index f6c02ce97e0a802b85f6021e822c89f8bf57d5cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1255 zcmaJ>TWs4@7*5+{G#S+&C!qC#> zf>5N3P6jO*Cz>ug*(_DmW=)kea&m$gZ^+nyiF`;j%w@}y8)>p*SH}C`m?DXeieF2U zyQHecc_L%Gh!7GMt+hG06y;+|p4>m~}PjA}rKViGiEnn7G0ZO<>G|7q;2?NwGCM3s?eued6%hd$B+ z*kQJ{#~$S=DFE(%=E+UkmlEI*%3llUf~8Ja9YU1Vui0IbGBkW_gHB%Rd&!!ioX zs40O?i9I{};kle7GMvE7(rk`la=gTI)47=>%?q@^iL-nUo3}h4S}N-KHn8t5mVP8w z&bSErwp+37 zNJJ8?a|{r5Q3R0Z5s-LB1WHOwYC@7pCHWND#cL1cZ?{kJ368_*(UDWUDyb<}0y@o# zfMF016iMWPCb6obAxT$JlB6(2DrlXDTB&!0`!m??4F(qWMhjVZo?JXQmz`1*58Z=& zcDmB|S-E@j?BoFGix0flckqdS4jsPNzhfWyWIM98GxcLs89C(~dw%$_t;JjX-SD}E zfiGV;{8Q%8r}w9x>EEigW81>`kvnU@pK)4+xk9@+bNj9L!AAZ@SZ@q|)&BmY3+HZx zul~BeG4|}-;L%cHViQGQX?^zFfO0&#cHwel=d`lH9sJ-@Sl@n*(8J2>%Ac`IxyY?Q z{=GhWvC#gu-~Ia7*n{=+;qM?Ul_wy1+u7ho;=`>EwP^g~R@{unBds`!#@}tluZQpS zm)M~nYEifJWJGx?_6DcTy>#uh%>!H9=hb^(v`=m3F1{L>db=<5_tm+_&knAQ2EU$s Mu9UqpbNZeC0BbUo^Z)<= diff --git a/VisualC-WinRT/testdraw/Assets/StoreLogo.png b/VisualC-WinRT/testdraw/Assets/StoreLogo.png deleted file mode 100644 index 7385b56c0e4d3c6b0efe3324aa1194157d837826..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1451 zcmaJ>eN5D57_Z|bH;{0+1#mbl)eTU3{h)Wf7EZV?;HD@XL@{B`Ui%(2aMxQ~xdXSv z5nzWi(LW)U2=Vc-cY@s7nPt{i0hc6!7xN4NNHI#EQl>YNBy8l4%x9gr_W-j zEZMQmmTIy(>;lblRfh`dIyTgc9W5d!VP$L4(kKrN1c5G~(O_#xG zAJCNTstD^5SeXFB+&$h=ToJP2H>xr$iqPs-#O*;4(!Fjw25-!gEb*)mU}=)J;Iu>w zxK(5XoD0wrPSKQ~rbL^Cw6O_03*l*}i=ydbu7adJ6y;%@tjFeXIXT+ms30pmbOP%Q zX}S;+LBh8Tea~TSkHzvX6$rYb)+n&{kSbIqh|c7hmlxmwSiq5iVhU#iEQ<>a18|O^Sln-8t&+t`*{qBWo5M?wFM(JuimAOb5!K#D}XbslM@#1ZVz_;!9U zpfEpLAOz=0g@bd6Xj_ILi-x^!M}73h^o@}hM$1jflTs|Yuj9AL@A3<-?MV4!^4q`e z)fO@A;{9K^?W?DbnesnPr6kK>$zaKo&;FhFd(GYFCIU^T+OIMb%Tqo+P%oq(IdX7S zf6+HLO?7o0m+p>~Tp5UrXWh!UH!wZ5kv!E`_w)PTpI(#Iw{AS`gH4^b(bm^ZCq^FZ zY9DD7bH}rq9mg88+KgA$Zp!iWncuU2n1AuIa@=sWvUR-s`Qb{R*kk(SPU^`$6BXz8 zn#7yaFOIK%qGxyi`dYtm#&qqox0$h=pNi#u=M8zUG@bpiZ=3sT=1}Trr}39cC)H|v zbL?W)=&s4zrh)7>L(|cc%$1#!zfL?HjpeP%T+x_a+jZ16b^iKOHxFEX$7d|8${H-* zIrOJ5w&i$>*D>AKaIoYg`;{L@jM((Kt?$N$5OnuPqVvq**Nm}(f0wwOF%iX_Pba;V z;m@wxX&NcV3?<1+u?A{y_DIj7#m3Af1rCE)o`D&Y3}0%7E;iX1yMDiS)sh0wKi!36 zL!Wmq?P^Ku&rK~HJd97KkLTRl>ScGFYZNlYytWnhmuu|)L&ND8_PmkayQb{HOY640 bno1(wj@u8DCVuFR|31B*4ek@pZJqxCDDe1x diff --git a/VisualC-WinRT/testdraw/Assets/Wide310x150Logo.scale-200.png b/VisualC-WinRT/testdraw/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 288995b397fdbef1fb7e85afd71445d5de1952c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3204 zcmbVPeQXow8NYmBd90>}0NP?GhXW~VaeThm=a0tV#EwJMI!)6M3}|c4_Bl3=Kd>G0 z(GHx1wl<7(tP?FsOQkTilSo*iIvF%uArExJ73~P zSv1xEy!U(Wd4A9D`FQV@W3@F^qJ@PEF$@z`Z!*BbFsS(^?B zyiAzJ+q})bkgiQHWqEb*jJD-coHYr1^iocg)l!Qa{Xqs-l~6J}p-|##ZHYofskQ3$ zI0;xzXyhazBeXhIsg5A=%ufo@f)1yy&ScKS0;HF^!r_2UE^lpZEom(+@duma3awTv zCrCL-%D_SvYWIcdHkmI}#50(fkUi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)ZSfn#yg0N)>!1kWdkqJ^S*z0FF5|fj&qcE#Na|%OY0$uO>!&hP+1ywfD_WXk@4J(?MBftK7>$Nvqh@tDuarN%PrTLQ2Uzysx>UV=V zk^RrDSvdQ?0;=hY67EgII-f4`t=+i*yS=Y~!XlqIy_4x&%+OdfbKOFPXS2X5%4R{N z$SQMX^AK6(fA - - - - - - - - - testdraw - Daniel - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VisualC-WinRT/testdraw/testdraw.vcxproj b/VisualC-WinRT/testdraw/testdraw.vcxproj deleted file mode 100644 index 86d985dba..000000000 --- a/VisualC-WinRT/testdraw/testdraw.vcxproj +++ /dev/null @@ -1,335 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - Debug - ARM - - - Release - ARM - - - Debug - ARM64 - - - Release - ARM64 - - - - {95943bbe-f378-4068-a3fd-dae1b8309b6e} - DirectXApp - testdraw - en-US - 14.0 - true - Windows Store - 10.0.19041.0 - 10.0.17763.0 - 10.0 - false - - - - Application - true - v142 - - - Application - true - v142 - - - Application - true - v142 - true - - - Application - true - v142 - - - Application - false - true - v142 - true - - - Application - false - true - v142 - true - - - Application - false - true - v142 - true - - - Application - false - true - v142 - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - _DEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - NDEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm64; $(VCInstallDir)\lib\arm64 - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - _DEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm64; $(VCInstallDir)\lib\arm64 - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - NDEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - _DEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - NDEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64 - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - _DEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies) - %(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64 - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions) - - - pch.h - $(IntDir)pch.pch - $(ProjectDir);$(IntermediateOutputPath);..\..\include - /bigobj %(AdditionalOptions) - 4453;28204 - NDEBUG;%(PreprocessorDefinitions) - false - NotUsing - - - - - $(TreatWarningsAsError) - - - - - - - - - - - - - - Designer - - - - - {89e9b32e-a86a-47c3-a948-d2b1622925ce} - - - - - - - - - - - - - - - true - true - true - true - true - true - true - true - - - false - false - false - false - false - false - false - false - - - - - - - - - - - - - - - diff --git a/VisualC-WinRT/testdraw/testdraw.vcxproj.filters b/VisualC-WinRT/testdraw/testdraw.vcxproj.filters deleted file mode 100644 index 2640e2a47..000000000 --- a/VisualC-WinRT/testdraw/testdraw.vcxproj.filters +++ /dev/null @@ -1,85 +0,0 @@ - - - - - 95943bbe-f378-4068-a3fd-dae1b8309b6e - - - dad3d573-ab33-428d-ae70-6098066c27e7 - bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png - - - e4caa635-e149-44c2-8915-48ffa6ac48f7 - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - Assets - - - - - Assets - - - - - - - - Content - - - Content - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - - - - - - - diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 10b055a0f..95f252f38 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3117,11 +3117,6 @@ typedef SDL_Colour, SDL_Color; + SDL_Color @@ @@ -- SDL_WinRTGetFSPathUTF8 -+ SDL_GetWinRTFSPath - (...) -@@ -@@ - SDL_iPhoneSetAnimationCallback + SDL_SetiOSAnimationCallback (...) @@ -3527,11 +3522,6 @@ typedef SDL_Colour, SDL_Color; (...) @@ @@ -- SDL_WinRTGetDeviceFamily -+ SDL_GetWinRTDeviceFamily - (...) -@@ -@@ - SDL_LinuxSetThreadPriority + SDL_SetLinuxThreadPriority (...) diff --git a/build-scripts/add-source-to-projects.pl b/build-scripts/add-source-to-projects.pl index 6d703dc36..5ba0a6975 100755 --- a/build-scripts/add-source-to-projects.pl +++ b/build-scripts/add-source-to-projects.pl @@ -591,7 +591,6 @@ foreach (@ARGV) { process_xcode($arg, 'Xcode/SDL/SDL.xcodeproj/project.pbxproj'); process_visualstudio($arg, 'VisualC/SDL/SDL.vcxproj'); process_visualstudio($arg, 'VisualC-GDK/SDL/SDL.vcxproj'); - process_visualstudio($arg, 'VisualC-WinRT/SDL-UWP.vcxproj'); } print("Done. Please run `git diff` and make sure this looks okay!\n"); diff --git a/build-scripts/rename_macros.py b/build-scripts/rename_macros.py index 913b10e5f..ba386cd41 100755 --- a/build-scripts/rename_macros.py +++ b/build-scripts/rename_macros.py @@ -129,7 +129,6 @@ RENAMED_MACROS = { "__VITA__": "SDL_PLATFORM_VITA", "__3DS__": "SDL_PLATFORM_3DS", # "__unix__": "SDL_PLATFORM_UNIX, - "__WINRT__": "SDL_PLATFORM_WINRT", "__XBOXSERIES__": "SDL_PLATFORM_XBOXSERIES", "__XBOXONE__": "SDL_PLATFORM_XBOXONE", "__WINDOWS__": "SDL_PLATFORM_WINDOWS", @@ -145,6 +144,7 @@ DEPRECATED_PLATFORM_MACROS = { "__NACL__", "__PNACL__", "__WINDOWS__", + "__WINRT__", "SDL_ALTIVEC_BLITTERS", "SDL_ARM_NEON_BLITTERS", "SDL_ARM_SIMD_BLITTERS", diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index faa79e657..e3766f0e1 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -21,12 +21,6 @@ endif() message(STATUS "CMAKE_SYSTEM_NAME= ${CMAKE_SYSTEM_NAME}") message(STATUS "CMAKE_SYSTEM_PROCESSOR= ${CMAKE_SYSTEM_PROCESSOR}") -if(WINDOWS_STORE) - enable_language(CXX) - add_compile_options("$<$:/ZW>") - set_source_files_properties(ain_cli.c main_gui.c PROPERTIES LANGUAGE CXX) -endif() - include(GenerateExportHeader) if(ANDROID) diff --git a/docs/README-migration.md b/docs/README-migration.md index 29a5bbce6..4be0642b9 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -836,6 +836,9 @@ The following hints have been removed: * SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING - SDL now properly handles the 0x406D1388 Exception if no debugger intercepts it, preventing its propagation. * SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS - Slim Reader/Writer Locks are always used if available * SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 - replaced with SDL_HINT_WINDOWS_CLOSE_ON_ALT_F4, defaulting to SDL_TRUE +* SDL_HINT_WINRT_HANDLE_BACK_BUTTON - WinRT support was removed in SDL3. +* SDL_HINT_WINRT_PRIVACY_POLICY_LABEL - WinRT support was removed in SDL3. +* SDL_HINT_WINRT_PRIVACY_POLICY_URL - WinRT support was removed in SDL3. * SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING * SDL_HINT_AUDIO_DEVICE_APP_NAME - replaced by either using the appname param to SDL_SetAppMetadata() or setting SDL_PROP_APP_METADATA_NAME_STRING with SDL_SetAppMetadataProperty() @@ -1118,11 +1121,14 @@ Using it is really simple: Just `#include ` in the source file Several platform-specific entry point functions have been removed as unnecessary. If for some reason you explicitly need them, here are easy replacements: ```c -#define SDL_WinRTRunApp(MAIN_FUNC, RESERVED) SDL_RunApp(0, NULL, MAIN_FUNC, RESERVED) #define SDL_UIKitRunApp(ARGC, ARGV, MAIN_FUNC) SDL_RunApp(ARGC, ARGV, MAIN_FUNC, NULL) #define SDL_GDKRunApp(MAIN_FUNC, RESERVED) SDL_RunApp(0, NULL, MAIN_FUNC, RESERVED) ``` +The following functions have been removed: +* SDL_WinRTRunApp() - WinRT support was removed in SDL3. + + ## SDL_messagebox.h The buttonid field of SDL_MessageBoxButtonData has been renamed buttonID. @@ -1275,7 +1281,6 @@ The following platform preprocessor macros have been renamed: | `__VITA__` | `SDL_PLATFORM_VITA` | | `__WIN32__` | `SDL_PLATFORM_WIN32` | | `__WINGDK__` | `SDL_PLATFORM_WINGDK` | -| `__WINRT__` | `SDL_PLATFORM_WINRT` | | `__XBOXONE__` | `SDL_PLATFORM_XBOXONE` | | `__XBOXSERIES__` | `SDL_PLATFORM_XBOXSERIES` | @@ -1288,6 +1293,8 @@ The following platform preprocessor macros have been removed: * `__NACL__` * `__PNACL__` * `__WINDOWS__` +* `__WINRT__` + ## SDL_quit.h @@ -1850,10 +1857,12 @@ SDL_RequestAndroidPermission is no longer a blocking call; the caller now provid SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump() have been renamed to SDL_SetiOSAnimationCallback() and SDL_SetiOSEventPump(), respectively. SDL2 has had macros to provide this new name with the old symbol since the introduction of the iPad, but now the correctly-named symbol is the only option. The following functions have been removed: +* SDL_GetWinRTFSPathUNICODE() - WinRT support was removed in SDL3. +* SDL_GetWinRTFSPathUTF8() - WinRT support was removed in SDL3. * SDL_RenderGetD3D11Device() - replaced with the "SDL.renderer.d3d11.device" property * SDL_RenderGetD3D12Device() - replaced with the "SDL.renderer.d3d12.device" property * SDL_RenderGetD3D9Device() - replaced with the "SDL.renderer.d3d9.device" property -* SDL_GetWinRTFSPathUNICODE() - Use SDL_GetWinRTFSPath() and SDL_iconv_string to convert from UTF-8 to UTF-16. +* SDL_WinRTGetDeviceFamily() - WinRT support was removed in SDL3. The following functions have been renamed: * SDL_AndroidBackButton() => SDL_SendAndroidBackButton() @@ -1874,8 +1883,6 @@ The following functions have been renamed: * SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy(), returns SDL_bool * SDL_OnApplicationDidBecomeActive() => SDL_OnApplicationDidEnterForeground() * SDL_OnApplicationWillResignActive() => SDL_OnApplicationWillEnterBackground() -* SDL_WinRTGetDeviceFamily() => SDL_GetWinRTDeviceFamily() -* SDL_GetWinRTFSPathUTF8() => SDL_GetWinRTFSPath() * SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns SDL_bool * SDL_iOSSetEventPump() => SDL_SetiOSEventPump() * SDL_iPhoneSetAnimationCallback() => SDL_SetiOSAnimationCallback(), returns SDL_bool diff --git a/docs/README-porting.md b/docs/README-porting.md index db6b61413..ada1d67cb 100644 --- a/docs/README-porting.md +++ b/docs/README-porting.md @@ -5,7 +5,7 @@ Porting The first thing you have to do when porting to a new platform, is look at include/SDL_platform.h and create an entry there for your operating system. -The standard format is "__PLATFORM__", where PLATFORM is the name of the OS. +The standard format is "SDL_PLATFORM_X", where X is the name of the OS. Ideally SDL_platform_defines.h will be able to auto-detect the system it's building on based on C preprocessor symbols. diff --git a/docs/README-windows.md b/docs/README-windows.md index daf80647f..ced972eeb 100644 --- a/docs/README-windows.md +++ b/docs/README-windows.md @@ -1,5 +1,11 @@ # Windows +## Old systems + +WinRT, Windows Phone, and UWP are no longer supported. + +All desktop Windows versions, back to Windows XP, are still supported. + ## LLVM and Intel C++ compiler support SDL will build with the Visual Studio project files with LLVM-based compilers, such as the Intel oneAPI C++ diff --git a/docs/README-winrt.md b/docs/README-winrt.md deleted file mode 100644 index 45ce80a4c..000000000 --- a/docs/README-winrt.md +++ /dev/null @@ -1,483 +0,0 @@ -WinRT -===== - -This port allows SDL applications to run on Microsoft's platforms that require -use of "Windows Runtime", aka. "WinRT", APIs. Microsoft may, in some cases, -refer to them as either "Windows Store", or for Windows 10, "UWP" apps. - -In the past, SDL has supported Windows RT 8.x, Windows Phone, etc, but in -modern times this port is focused on UWP apps, which run on Windows 10, -and modern Xbox consoles. - - -Requirements ------------- - -* Microsoft Visual C++ (aka Visual Studio) 2019. - - Free, "Community" or "Express" editions may be used, so long as they - include support for either "Windows Store" or "Windows Phone" apps. - "Express" versions marked as supporting "Windows Desktop" development - typically do not include support for creating WinRT apps, to note. - (The "Community" editions of Visual C++ do, however, support both - desktop/Win32 and WinRT development). -* A valid Microsoft account - This requirement is not imposed by SDL, but - rather by Microsoft's Visual C++ toolchain. This is required to launch or - debug apps. - - -Status ------- - -Here is a rough list of what works, and what doesn't: - -* What works: - * compilation via Visual C++ 2019. - * compile-time platform detection for SDL programs. The C/C++ #define, - `SDL_PLATFORM_WINRT`, will be set to 1 (by SDL) when compiling for WinRT. - * GPU-accelerated 2D rendering, via SDL_Renderer. - * OpenGL ES 2, via the ANGLE library (included separately from SDL) - * software rendering, via either SDL_Surface (optionally in conjunction with - SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the - SDL_Renderer APIs - * threads - * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(), - SDL_GetPerformanceFrequency(), etc.) - * file I/O via SDL_IOStream - * mouse input (unsupported on Windows Phone) - * audio, via SDL's WASAPI backend (if you want to record, your app must - have "Microphone" capabilities enabled in its manifest, and the user must - not have blocked access. Otherwise, recording devices will fail to work, - presenting as a device disconnect shortly after opening it.) - * .DLL file loading. Libraries *MUST* be packaged inside applications. Loading - anything outside of the app is not supported. - * system path retrieval via SDL's filesystem APIs - * game controllers. Support is provided via the SDL_Joystick and - SDL_Gamepad APIs, and is backed by Microsoft's XInput API. Please - note, however, that Windows limits game-controller support in UWP apps to, - "Xbox compatible controllers" (many controllers that work in Win32 apps, - do not work in UWP, due to restrictions in UWP itself.) - * multi-touch input - * app events. SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as - appropriate. - * window events - * using Direct3D 11.x APIs outside of SDL. Non-XAML / Direct3D-only apps can - choose to render content directly via Direct3D, using SDL to manage the - internal WinRT window, as well as input and audio. (Use - the window properties to get the WinRT 'CoreWindow', and pass it into - IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.) - -* What partially works: - * keyboard input. Most of WinRT's documented virtual keys are supported, as - well as many keys with documented hardware scancodes. Converting - SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs - (MapVirtualKey()) in Microsoft's Windows Store / UWP APIs. - * SDL_main. WinRT uses a different signature for each app's main() function - and requires it to be implemented in C++, so SDL_main.h must be #include'd - in a C++ source file, that also must be compiled with /ZW. - -* What doesn't work: - * compilation with anything other than Visual C++ - * programmatically-created custom cursors. These don't appear to be supported - by WinRT. Different OS-provided cursors can, however, be created via - SDL_CreateSystemCursor() (unsupported on Windows Phone) - * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal(). This are not currently - supported by WinRT itself. - * joysticks and game controllers that either are not supported by - Microsoft's XInput API, or are not supported within UWP apps (many - controllers that work in Win32, do not work in UWP, due to restrictions in - UWP itself). - * turning off VSync when rendering on Windows Phone. Attempts to turn VSync - off on Windows Phone result either in Direct3D not drawing anything, or it - forcing VSync back on. As such, vsync will always get turned-on on Windows - Phone. This limitation is not present in non-Phone WinRT (such as Windows 8.x), - where turning off VSync appears to work. - * probably anything else that's not listed as supported - - - -Setup, High-Level Steps ------------------------ - -The steps for setting up a project for an SDL/WinRT app looks like the -following, at a high-level: - -1. create a new Visual C++ project using Microsoft's template for a, - "Direct3D App". -2. remove most of the files from the project. -3. make your app's project directly reference SDL/WinRT's own Visual C++ - project file, via use of Visual C++'s "References" dialog. This will setup - the linker, and will copy SDL's .dll files to your app's final output. -4. adjust your app's build settings, at minimum, telling it where to find SDL's - header files. -5. add files that contains a WinRT-appropriate main function, along with some - data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls) - work properly. -6. add SDL-specific app code. -7. build and run your app. - - -Setup, Detailed Steps ---------------------- - -### 1. Create a new project ### - -Create a new project using one of Visual C++'s templates for a plain, non-XAML, -"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use). If you -don't see one of these templates, in Visual C++'s 'New Project' dialog, try -using the textbox titled, 'Search Installed Templates' to look for one. - - -### 2. Remove unneeded files from the project ### - -In the new project, delete any file that has one of the following extensions: - -- .cpp -- .h -- .hlsl - -When you are done, you should be left with a few files, each of which will be a -necessary part of your app's project. These files will consist of: - -- an .appxmanifest file, which contains metadata on your WinRT app. This is - similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android. -- a few .png files, one of which is a splash screen (displayed when your app - launches), others are app icons. -- a .pfx file, used for code signing purposes. - - -### 3. Add references to SDL's project files ### - -SDL/WinRT can be built in multiple variations, spanning across three different -CPU architectures (x86, x64, and ARM) and two different configurations -(Debug and Release). WinRT and Visual C++ do not currently provide a means -for combining multiple variations of one library into a single file. -Furthermore, it does not provide an easy means for copying pre-built .dll files -into your app's final output (via Post-Build steps, for example). It does, -however, provide a system whereby an app can reference the MSVC projects of -libraries such that, when the app is built: - -1. each library gets built for the appropriate CPU architecture(s) and WinRT - platform(s). -2. each library's output, such as .dll files, get copied to the app's build - output. - -To set this up for SDL/WinRT, you'll need to run through the following steps: - -1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then - "Solution Explorer") -2. right click on your app's solution. -3. navigate to "Add", then to "Existing Project..." -4. find SDL/WinRT's Visual C++ project file and open it, in the `VisualC-WinRT` - directory. -5. once the project has been added, right-click on your app's project and - select, "References..." -6. click on the button titled, "Add New Reference..." -7. check the box next to SDL -8. click OK to close the dialog -9. SDL will now show up in the list of references. Click OK to close that - dialog. - -Your project is now linked to SDL's project, insofar that when the app is -built, SDL will be built as well, with its build output getting included with -your app. - - -### 4. Adjust Your App's Build Settings ### - -Some build settings need to be changed in your app's project. This guide will -outline the following: - -- making sure that the compiler knows where to find SDL's header files -- **Optional for C++, but NECESSARY for compiling C code:** telling the - compiler not to use Microsoft's C++ extensions for WinRT development. -- **Optional:** telling the compiler not generate errors due to missing - precompiled header files. - -To change these settings: - -1. right-click on the project -2. choose "Properties" -3. in the drop-down box next to "Configuration", choose, "All Configurations" -4. in the drop-down box next to "Platform", choose, "All Platforms" -5. in the left-hand list, expand the "C/C++" section - **Note:** If you don't see this section, you may have to add a .c or .cpp - Source file to the Project first. -6. select "General" -7. edit the "Additional Include Directories" setting, and add a path to SDL's - "include" directory -8. **Optional: to enable compilation of C code:** change the setting for - "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No". If you're - working with a completely C++ based project, this step can usually be - omitted. -9. **Optional: to disable precompiled headers (which can produce - 'stdafx.h'-related build errors, if setup incorrectly:** in the left-hand - list, select "Precompiled Headers", then change the setting for "Precompiled - Header" from "Use (/Yu)" to "Not Using Precompiled Headers". -10. close the dialog, saving settings, by clicking the "OK" button - - -### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ### - -A few files should be included directly in your app's MSVC project, specifically: -1. a WinRT-appropriate main function (which is different than main() functions on - other platforms) -2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor - (if and when the app needs to do so). *If this cursor resource is not - included, mouse-position reporting may fail if and when the cursor is - hidden, due to possible bugs/design-oddities in Windows itself.* - -To include these files for C/C++ projects: - -1. right-click on your project (again, in Visual C++'s Solution Explorer), - navigate to "Add", then choose "Existing Item...". -2. navigate to the directory containing SDL's source code, then into its - subdirectory, 'src/main/winrt/'. Select, then add, the following files: - - `SDL3-WinRTResources.rc` - - `SDL3-WinRTResource_BlankCursor.cur` -3. For the next step you need a C++ source file. - - If your standard main() function is implemented in a **C++** source file, - use that file. - - If your standard main() function is implemented in a **plain C** source file, - create an empty .cpp source file (e.g. `main.cpp`) that only contains the line - `#include ` and use that file instead. -4. Right click on the C++ source file from step 3 (as listed in your project), - then click on "Properties...". -5. in the drop-down box next to "Configuration", choose, "All Configurations" -6. in the drop-down box next to "Platform", choose, "All Platforms" -7. in the left-hand list, click on "C/C++" -8. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)". -9. click the OK button. This will close the dialog. - -**NOTE: C++/CX compilation is currently required in at least one file of your -app's project. This is to make sure that Visual C++'s linker builds a 'Windows -Metadata' file (.winmd) for your app. Not doing so can lead to build errors.** - -For non-C++ projects, you will need to call SDL_RunApp from your language's -main function, and generate SDL3-WinRTResources.res manually by using `rc` via -the Developer Command Prompt and including it as a within the -first block in your Visual Studio project file. - -### 6. Add app code and assets ### - -At this point, you can add in SDL-specific source code. Be sure to include a -C-style main function (ie: `int main(int argc, char *argv[])`). From there you -should be able to create a single `SDL_Window` (WinRT apps can only have one -window, at present), as well as an `SDL_Renderer`. Direct3D will be used to -draw content. Events are received via SDL's usual event functions -(`SDL_PollEvent`, etc.) If you have a set of existing source files and assets, -you can start adding them to the project now. If not, or if you would like to -make sure that you're setup correctly, some short and simple sample code is -provided below. - - -#### 6.A. ... when creating a new app #### - -If you are creating a new app (rather than porting an existing SDL-based app), -or if you would just like a simple app to test SDL/WinRT with before trying to -get existing code working, some working SDL/WinRT code is provided below. To -set this up: - -1. right click on your app's project -2. select Add, then New Item. An "Add New Item" dialog will show up. -3. from the left-hand list, choose "Visual C++" -4. from the middle/main list, choose "C++ File (.cpp)" -5. near the bottom of the dialog, next to "Name:", type in a name for your -source file, such as, "main.cpp". -6. click on the Add button. This will close the dialog, add the new file to -your project, and open the file in Visual C++'s text editor. -7. Copy and paste the following code into the new file, then save it. - -```c -#include -#include - -int main(int argc, char **argv) -{ - SDL_Window *window = NULL; - SDL_Renderer *renderer = NULL; - SDL_Event evt; - SDL_bool keep_going = SDL_TRUE; - - if (!SDL_Init(SDL_INIT_VIDEO)) { - return 1; - } else if (!SDL_CreateWindowAndRenderer("Hello SDL", 0, 0, SDL_WINDOW_FULLSCREEN, &window, &renderer)) { - return 1; - } - - while (keep_going) { - while (SDL_PollEvent(&evt)) { - if ((evt.type == SDL_EVENT_KEY_DOWN) && (evt.key.keysym.sym == SDLK_ESCAPE)) { - keep_going = SDL_FALSE; - } - } - - SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255); - SDL_RenderClear(renderer); - SDL_RenderPresent(renderer); - } - - SDL_Quit(); - return 0; -} -``` - -#### 6.B. Adding code and assets #### - -If you have existing code and assets that you'd like to add, you should be able -to add them now. The process for adding a set of files is as such. - -1. right click on the app's project -2. select Add, then click on "New Item..." -3. open any source, header, or asset files as appropriate. Support for C and -C++ is available. - -Do note that WinRT only supports a subset of the APIs that are available to -Win32-based apps. Many portions of the Win32 API and the C runtime are not -available. - -A list of unsupported C APIs can be found at - - -General information on using the C runtime in WinRT can be found at - - -A list of supported Win32 APIs for WinRT apps can be found at -. To note, -the list of supported Win32 APIs for Windows Phone 8.0 is different. -That list can be found at - - - -### 7. Build and run your app ### - -Your app project should now be setup, and you should be ready to build your app. -To run it on the local machine, open the Debug menu and choose "Start -Debugging". This will build your app, then run your app full-screen. To switch -out of your app, press the Windows key. Alternatively, you can choose to run -your app in a window. To do this, before building and running your app, find -the drop-down menu in Visual C++'s toolbar that says, "Local Machine". Expand -this by clicking on the arrow on the right side of the list, then click on -Simulator. Once you do that, any time you build and run the app, the app will -launch in window, rather than full-screen. - - -#### 7.A. Running apps on older, ARM-based, "Windows RT" devices #### - -**These instructions do not include Windows Phone, despite Windows Phone -typically running on ARM processors.** They are specifically for devices -that use the "Windows RT" operating system, which was a modified version of -Windows 8.x that ran primarily on ARM-based tablet computers. - -To build and run the app on ARM-based, "Windows RT" devices, you'll need to: - -- install Microsoft's "Remote Debugger" on the device. Visual C++ installs and - debugs ARM-based apps via IP networks. -- change a few options on the development machine, both to make sure it builds - for ARM (rather than x86 or x64), and to make sure it knows how to find the - Windows RT device (on the network). - -Microsoft's Remote Debugger can be found at -. Please note -that separate versions of this debugger exist for different versions of Visual -C++, one each for MSVC 2015, 2013, and 2012. - -To setup Visual C++ to launch your app on an ARM device: - -1. make sure the Remote Debugger is running on your ARM device, and that it's on - the same IP network as your development machine. -2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32". Click - it, then change the value to "ARM". -3. make sure Visual C++ knows the hostname or IP address of the ARM device. To - do this: - 1. open the app project's properties - 2. select "Debugging" - 3. next to "Machine Name", enter the hostname or IP address of the ARM - device - 4. if, and only if, you've turned off authentication in the Remote Debugger, - then change the setting for "Require Authentication" to No - 5. click "OK" -4. build and run the app (from Visual C++). The first time you do this, a - prompt will show up on the ARM device, asking for a Microsoft Account. You - do, unfortunately, need to log in here, and will need to follow the - subsequent registration steps in order to launch the app. After you do so, - if the app didn't already launch, try relaunching it again from within Visual - C++. - - -Troubleshooting ---------------- - -#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'" - -Try adding the following to your linker flags. In MSVC, this can be done by -right-clicking on the app project, navigating to Configuration Properties -> -Linker -> Command Line, then adding them to the Additional Options -section. - -* For Release builds / MSVC-Configurations, add: - - /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib - -* For Debug builds / MSVC-Configurations, add: - - /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib - - -#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values - -This may be caused by a bug in Windows itself, whereby hiding the mouse -cursor can cause mouse-position reporting to fail. - -SDL provides a workaround for this, but it requires that an app links to a -set of Win32-style cursor image-resource files. A copy of suitable resource -files can be found in `src/main/winrt/`. Adding them to an app's Visual C++ -project file should be sufficient to get the app to use them. - - -#### SDL's Visual Studio project file fails to open, with message, "The system can't find the file specified." - -This can be caused for any one of a few reasons, which Visual Studio can -report, but won't always do so in an up-front manner. - -To help determine why this error comes up: - -1. open a copy of Visual Studio without opening a project file. This can be - accomplished via Windows' Start Menu, among other means. -2. show Visual Studio's Output window. This can be done by going to VS' - menu bar, then to View, and then to Output. -3. try opening the SDL project file directly by going to VS' menu bar, then - to File, then to Open, then to Project/Solution. When a File-Open dialog - appears, open the SDL project (such as the one in SDL's source code, in its - directory, VisualC-WinRT/UWP_VS2015/). -4. after attempting to open SDL's Visual Studio project file, additional error - information will be output to the Output window. - -If Visual Studio reports (via its Output window) that the project: - -"could not be loaded because it's missing install components. To fix this launch Visual Studio setup with the following selections: -Microsoft.VisualStudio.ComponentGroup.UWP.VC" - -... then you will need to re-launch Visual Studio's installer, and make sure that -the workflow for "Universal Windows Platform development" is checked, and that its -optional component, "C++ Universal Windows Platform tools" is also checked. While -you are there, if you are planning on targeting UWP / Windows 10, also make sure -that you check the optional component, "Windows 10 SDK (10.0.10240.0)". After -making sure these items are checked as-appropriate, install them. - -Once you install these components, try re-launching Visual Studio, and re-opening -the SDL project file. If you still get the error dialog, try using the Output -window, again, seeing what Visual Studio says about it. - - -#### Game controllers / joysticks aren't working! - -Windows only permits certain game controllers and joysticks to work within -WinRT / UWP apps. Even if a game controller or joystick works in a Win32 -app, that device is not guaranteed to work inside a WinRT / UWP app. - -According to Microsoft, "Xbox compatible controllers" should work inside -UWP apps, potentially with more working in the future. This includes, but -may not be limited to, Microsoft-made Xbox controllers and USB adapters. -(Source: https://social.msdn.microsoft.com/Forums/en-US/9064838b-e8c3-4c18-8a83-19bf0dfe150d/xinput-fails-to-detect-game-controllers?forum=wpdevelop) - - diff --git a/docs/README.md b/docs/README.md index a94fdd3cf..812d3ce65 100644 --- a/docs/README.md +++ b/docs/README.md @@ -48,7 +48,6 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd - [Raspberry Pi](README-raspberrypi.md) - [RISC OS](README-riscos.md) - [Windows GDK](README-gdk.md) -- [Windows UWP](README-winrt.md) - [Windows](README-windows.md) If you need help with the library, or just want to discuss SDL related diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index acbd1d112..e3527d087 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -23,12 +23,6 @@ if(NOT (MSVC AND SDL_CPU_ARM64)) find_package(OpenGL) endif() -if(WINDOWS_STORE) - cmake_minimum_required(VERSION 3.19) - # CMP0112: Target file component generator expressions do not add target dependencies. - cmake_policy(SET CMP0112 NEW) -endif() - set(SDL_EXAMPLE_EXECUTABLES) if(CMAKE_RUNTIME_OUTPUT_DIRECTORY) @@ -62,15 +56,6 @@ add_custom_target(copy-sdl-example-resources DEPENDS "${RESOURCE_FILES_BINDIR}" ) -if(WINDOWS_STORE) - add_library(sdl_example_main_callbacks_uwp OBJECT ${CMAKE_CURRENT_SOURCE_DIR}/../test/main.cpp) - target_link_libraries(sdl_example_main_callbacks_uwp PRIVATE SDL3::Headers) - target_compile_options(sdl_example_main_callbacks_uwp PRIVATE "/ZW") - target_compile_definitions(sdl_example_main_callbacks_uwp PRIVATE "SDL_MAIN_USE_CALLBACKS") - - set_source_files_properties(${RESOURCE_FILES} PROPERTIES VS_DEPLOYENT_LOCATION "Assets") -endif() - macro(add_sdl_example_executable TARGET) cmake_parse_arguments(AST "BUILD_DEPENDENT" "" "SOURCES;DATAFILES" ${ARGN}) if(AST_UNPARSED_ARGUMENTS) @@ -80,28 +65,6 @@ macro(add_sdl_example_executable TARGET) message(FATAL_ERROR "add_sdl_example_executable needs at least one source") endif() set(EXTRA_SOURCES "") - if(WINDOWS_STORE) - set(uwp_bindir "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.dir") - if(NOT IS_DIRECTORY "${uwp_bindir}") - execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${uwp_bindir}") - endif() - string(REGEX REPLACE "[_]" "" SAFE_TARGET "${TARGET}") - file(GENERATE OUTPUT "${uwp_bindir}/${TARGET}.appxmanifest" - INPUT "${CMAKE_CURRENT_SOURCE_DIR}/../test/uwp/Package.appxmanifest.in" - TARGET "${TARGET}" - ) - set_property(SOURCE "${uwp_bindir}/${TARGET}.appxmanifest" PROPERTY VS_DEPLOYMENT_CONTENT 1) - - list(APPEND EXTRA_SOURCES "$") - - list(APPEND EXTRA_SOURCES - "${uwp_bindir}/${TARGET}.appxmanifest" - "${CMAKE_CURRENT_SOURCE_DIR}/../test/uwp/logo-50x50.png" - "${CMAKE_CURRENT_SOURCE_DIR}/../test/uwp/square-44x44.png" - "${CMAKE_CURRENT_SOURCE_DIR}/../test/uwp/square-150x150.png" - "${CMAKE_CURRENT_SOURCE_DIR}/../test/uwp/splash-620x300.png" - ) - endif() if(AST_DATAFILES) list(APPEND EXTRA_SOURCES ${DATAFILES}) endif() @@ -122,17 +85,6 @@ macro(add_sdl_example_executable TARGET) COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${AST_DATAFILES} $/sdl-${TARGET} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" ) - elseif(WINDOWS_STORE) - # MSVC does build the dependent targets (or POST_BUILD commands) when building an application - # after starting to debug. By copying the resources in a custom target, the files can be copied afterwards. - # FIXME: find out proper way to add assets to UWP package - cmake_minimum_required(VERSION 3.19) - add_custom_target(zzz-resources-copy-${TARGET} - COMMAND ${CMAKE_COMMAND} -E make_directory "$/AppX" - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${AST_DATAFILES} "$/AppX" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - ) - add_dependencies(${TARGET} zzz-resources-copy-${TARGET}) else() add_dependencies(${TARGET} copy-sdl-example-resources) endif() @@ -156,20 +108,7 @@ macro(add_sdl_example_executable TARGET) endif() elseif(PSP) target_link_libraries(${TARGET} PRIVATE GL) - endif() - if(WINDOWS_STORE) - target_compile_definitions(${TARGET} PRIVATE "SDL_MAIN_NOIMPL") - set_property(TARGET ${TARGET} PROPERTY WIN32_EXECUTABLE TRUE) - set_property(TARGET ${TARGET} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${uwp_bindir}") - target_link_options(${TARGET} PRIVATE - -nodefaultlib:vccorlib$<$:d> - -nodefaultlib:msvcrt$<$:d> - vccorlib$<$:d>.lib - msvcrt$<$:d>.lib - ) - endif() - - if(EMSCRIPTEN) + elseif(EMSCRIPTEN) set_property(TARGET ${TARGET} PROPERTY SUFFIX ".html") endif() diff --git a/include/SDL3/SDL_begin_code.h b/include/SDL3/SDL_begin_code.h index ff5ba0273..2a38fc04b 100644 --- a/include/SDL3/SDL_begin_code.h +++ b/include/SDL3/SDL_begin_code.h @@ -53,7 +53,7 @@ /* Some compilers use a special export keyword */ #ifndef SDL_DECLSPEC -# if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_CYGWIN) || defined(SDL_PLATFORM_GDK) +# if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_CYGWIN) || defined(SDL_PLATFORM_GDK) # ifdef DLL_EXPORT # define SDL_DECLSPEC __declspec(dllexport) # else @@ -70,7 +70,7 @@ /* By default SDL uses the C calling convention */ #ifndef SDLCALL -#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK)) && !defined(__GNUC__) +#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && !defined(__GNUC__) #define SDLCALL __cdecl #else #define SDLCALL diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index 5faa244b8..553f56b6c 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -143,19 +143,19 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetPrefPath(const char *org, const char * * * The folders supported per platform are: * - * | | Windows | WinRT/UWP |macOS/iOS | tvOS | Unix (XDG) | Haiku | Emscripten | - * | ----------- | ------- | --------- |--------- | ---- | ---------- | ----- | ---------- | - * | HOME | X | X | X | | X | X | X | - * | DESKTOP | X | X | X | | X | X | | - * | DOCUMENTS | X | X | X | | X | | | - * | DOWNLOADS | Vista+ | X | X | | X | | | - * | MUSIC | X | X | X | | X | | | - * | PICTURES | X | X | X | | X | | | - * | PUBLICSHARE | | | X | | X | | | - * | SAVEDGAMES | Vista+ | | | | | | | - * | SCREENSHOTS | Vista+ | X | | | | | | - * | TEMPLATES | X | X | X | | X | | | - * | VIDEOS | X | X | X* | | X | | | + * | | Windows | macOS/iOS | tvOS | Unix (XDG) | Haiku | Emscripten | + * | ----------- | ------- | --------- | ---- | ---------- | ----- | ---------- | + * | HOME | X | X | | X | X | X | + * | DESKTOP | X | X | | X | X | | + * | DOCUMENTS | X | X | | X | | | + * | DOWNLOADS | Vista+ | X | | X | | | + * | MUSIC | X | X | | X | | | + * | PICTURES | X | X | | X | | | + * | PUBLICSHARE | | X | | X | | | + * | SAVEDGAMES | Vista+ | | | | | | + * | SCREENSHOTS | Vista+ | | | | | | + * | TEMPLATES | X | X | | X | | | + * | VIDEOS | X | X* | | X | | | * * Note that on macOS/iOS, the Videos folder is called "Movies". * diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 708c329db..6a376f0c4 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -3938,119 +3938,6 @@ extern "C" { */ #define SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE "SDL_WINDOWS_ERASE_BACKGROUND_MODE" -/** - * A variable controlling whether back-button-press events on Windows Phone to - * be marked as handled. - * - * Windows Phone devices typically feature a Back button. When pressed, the OS - * will emit back-button-press events, which apps are expected to handle in an - * appropriate manner. If apps do not explicitly mark these events as - * 'Handled', then the OS will invoke its default behavior for unhandled - * back-button-press events, which on Windows Phone 8 and 8.1 is to terminate - * the app (and attempt to switch to the previous app, or to the device's home - * screen). - * - * Setting the SDL_HINT_WINRT_HANDLE_BACK_BUTTON hint to "1" will cause SDL to - * mark back-button-press events as Handled, if and when one is sent to the - * app. - * - * Internally, Windows Phone sends back button events as parameters to special - * back-button-press callback functions. Apps that need to respond to - * back-button-press events are expected to register one or more callback - * functions for such, shortly after being launched (during the app's - * initialization phase). After the back button is pressed, the OS will invoke - * these callbacks. If the app's callback(s) do not explicitly mark the event - * as handled by the time they return, or if the app never registers one of - * these callback, the OS will consider the event un-handled, and it will - * apply its default back button behavior (terminate the app). - * - * SDL registers its own back-button-press callback with the Windows Phone OS. - * This callback will emit a pair of SDL key-press events (SDL_EVENT_KEY_DOWN - * and SDL_EVENT_KEY_UP), each with a scancode of SDL_SCANCODE_AC_BACK, after - * which it will check the contents of the hint, - * SDL_HINT_WINRT_HANDLE_BACK_BUTTON. If the hint's value is set to "1", the - * back button event's Handled property will get set to 'true'. If the hint's - * value is set to something else, or if it is unset, SDL will leave the - * event's Handled property alone. (By default, the OS sets this property to - * 'false', to note.) - * - * SDL apps can either set SDL_HINT_WINRT_HANDLE_BACK_BUTTON well before a - * back button is pressed, or can set it in direct-response to a back button - * being pressed. - * - * In order to get notified when a back button is pressed, SDL apps should - * register a callback function with SDL_AddEventWatch(), and have it listen - * for SDL_EVENT_KEY_DOWN events that have a scancode of SDL_SCANCODE_AC_BACK. - * (Alternatively, SDL_EVENT_KEY_UP events can be listened-for. Listening for - * either event type is suitable.) Any value of - * SDL_HINT_WINRT_HANDLE_BACK_BUTTON set by such a callback, will be applied - * to the OS' current back-button-press event. - * - * More details on back button behavior in Windows Phone apps can be found at - * the following page, on Microsoft's developer site: - * http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON" - -/** - * A variable specifying the label text for a WinRT app's privacy policy link. - * - * Network-enabled WinRT apps must include a privacy policy. On Windows 8, - * 8.1, and RT, Microsoft mandates that this policy be available via the - * Windows Settings charm. SDL provides code to add a link there, with its - * label text being set via the optional hint, - * SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that a privacy policy's contents are not set via this hint. A - * separate hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the - * actual text of the policy. - * - * The contents of this hint should be encoded as a UTF8 string. - * - * The default value is "Privacy Policy". - * - * For additional information on linking to a privacy policy, see the - * documentation for SDL_HINT_WINRT_PRIVACY_POLICY_URL. - * - * This hint should be set before SDL is initialized. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL" - -/** - * A variable specifying the URL to a WinRT app's privacy policy. - * - * All network-enabled WinRT apps must make a privacy policy available to its - * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be - * available in the Windows Settings charm, as accessed from within the app. - * SDL provides code to add a URL-based link there, which can point to the - * app's privacy policy. - * - * To setup a URL to an app's privacy policy, set - * SDL_HINT_WINRT_PRIVACY_POLICY_URL before calling any SDL_Init() functions. - * The contents of the hint should be a valid URL. For example, - * "http://www.example.com". - * - * The default value is "", which will prevent SDL from adding a privacy - * policy link to the Settings charm. This hint should only be set during app - * init. - * - * The label text of an app's "Privacy Policy" link may be customized via - * another hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL. - * - * Please note that on Windows Phone, Microsoft does not provide standard UI - * for displaying a privacy policy link, and as such, - * SDL_HINT_WINRT_PRIVACY_POLICY_URL will not get used on that platform. - * Network-enabled phone apps should display their privacy policy through some - * other, in-app means. - * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL" - /** * A variable controlling whether X11 windows are marked as override-redirect. * diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h index 12e8ffdca..a5a877bf5 100644 --- a/include/SDL3/SDL_main.h +++ b/include/SDL3/SDL_main.h @@ -48,20 +48,6 @@ */ #define SDL_MAIN_AVAILABLE - #elif defined(SDL_PLATFORM_WINRT) - /* On WinRT, SDL provides a main function that initializes CoreApplication, - creating an instance of IFrameworkView in the process. - - Ideally, #include'ing SDL_main.h is enough to get a main() function working. - However, that requires the source file your main() is in to be compiled - as C++ *and* with the /ZW compiler flag. If that's not feasible, add an - otherwise empty .cpp file that only contains `#include ` - and build that with /ZW (still include SDL_main.h in your other file with main()!). - In XAML apps, instead the function SDL_RunApp() must be called with a pointer - to the Direct3D-hosted XAML control passed in as the "reserved" argument. - */ - #define SDL_MAIN_NEEDED - #elif defined(SDL_PLATFORM_GDK) /* On GDK, SDL provides a main function that initializes the game runtime. @@ -591,7 +577,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); /* platforms which main (-equivalent) can be implemented in plain C */ #include - #elif defined(SDL_PLATFORM_WINRT) /* C++ platforms */ + #elif 0 /* C++ platforms (currently none, this used to be here for WinRT, but is left for future platforms that might arrive. */ #ifdef __cplusplus #include #else @@ -605,7 +591,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void); #endif /* __GNUC__ */ #endif /* __cplusplus */ - #endif /* C++ platforms like SDL_PLATFORM_WINRT etc */ + #endif /* C++ platforms */ #endif #endif /* SDL_main_h_ */ diff --git a/include/SDL3/SDL_main_impl.h b/include/SDL3/SDL_main_impl.h index ad122dfc5..d46518c07 100644 --- a/include/SDL3/SDL_main_impl.h +++ b/include/SDL3/SDL_main_impl.h @@ -126,70 +126,6 @@ /* end of SDL_PLATFORM_WIN32 and SDL_PLATFORM_GDK impls */ - #elif defined(SDL_PLATFORM_WINRT) - - /* WinRT main based on SDL_winrt_main_NonXAML.cpp, placed in the public domain by David Ludwig 3/13/14 */ - - #include - - /* At least one file in any SDL/WinRT app appears to require compilation - with C++/CX, otherwise a Windows Metadata file won't get created, and - an APPX0702 build error can appear shortly after linking. - - The following set of preprocessor code forces this file to be compiled - as C++/CX, which appears to cause Visual C++ 2012's build tools to - create this .winmd file, and will help allow builds of SDL/WinRT apps - to proceed without error. - - If other files in an app's project enable C++/CX compilation, then it might - be possible for the .cpp file including SDL_main.h to be compiled without /ZW, - for Visual C++'s build tools to create a winmd file, and for the app to - build without APPX0702 errors. In this case, if - SDL_WINRT_METADATA_FILE_AVAILABLE is defined as a C/C++ macro, then - the #error (to force C++/CX compilation) will be disabled. - - Please note that /ZW can be specified on a file-by-file basis. To do this, - right click on the file in Visual C++, click Properties, then change the - setting through the dialog that comes up. - */ - #ifndef SDL_WINRT_METADATA_FILE_AVAILABLE - #if !defined(__cplusplus) || (!defined(__cplusplus_winrt) && _MSVC_LANG < 202002L) - #error The C++ file that includes SDL_main.h must be compiled as C++ code with /ZW, otherwise build errors due to missing .winmd files can occur. - #endif - #endif - - /* Prevent MSVC++ from warning about threading models when defining our - custom WinMain. The threading model will instead be set via a direct - call to Windows::Foundation::Initialize (rather than via an attributed - function). - - To note, this warning (C4447) does not seem to come up unless this file - is compiled with C++/CX enabled (via the /ZW compiler flag). - */ - #ifdef _MSC_VER - #pragma warning(disable : 4447) - /* Make sure the function to initialize the Windows Runtime gets linked in. */ - #pragma comment(lib, "runtimeobject.lib") - #endif - - #ifdef __cplusplus - extern "C" { - #endif - int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int) - { - return SDL_RunApp(0, NULL, SDL_main, NULL); - } - #if _MSVC_LANG >= 202002L - int main(int argc, char** argv) { - return SDL_RunApp(argc, argv, SDL_main, NULL); - } - #endif - #ifdef __cplusplus - } /* extern "C" */ - #endif - - /* end of WinRT impl */ - #elif defined(SDL_PLATFORM_NGAGE) /* same typedef as in ngage SDKs e32def.h */ typedef signed int TInt; diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 2795191ce..de5e69842 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -625,8 +625,6 @@ #define SDL_LinuxSetThreadPriorityAndPolicy SDL_SetLinuxThreadPriorityAndPolicy #define SDL_OnApplicationDidBecomeActive SDL_OnApplicationDidEnterForeground #define SDL_OnApplicationWillResignActive SDL_OnApplicationWillEnterBackground -#define SDL_WinRTGetDeviceFamily SDL_GetWinRTDeviceFamily -#define SDL_GetWinRTFSPathUTF8 SDL_GetWinRTFSPath #define SDL_iOSSetAnimationCallback SDL_SetiOSAnimationCallback #define SDL_iOSSetEventPump SDL_SetiOSEventPump #define SDL_iPhoneSetAnimationCallback SDL_SetiOSAnimationCallback @@ -1251,8 +1249,6 @@ #define SDL_LinuxSetThreadPriorityAndPolicy SDL_LinuxSetThreadPriorityAndPolicy_renamed_SDL_SetLinuxThreadPriorityAndPolicy #define SDL_OnApplicationDidBecomeActive SDL_OnApplicationDidBecomeActive_renamed_SDL_OnApplicationDidEnterForeground #define SDL_OnApplicationWillResignActive SDL_OnApplicationWillResignActive_renamed_SDL_OnApplicationWillEnterBackground -#define SDL_WinRTGetDeviceFamily SDL_WinRTGetDeviceFamily_renamed_SDL_GetWinRTDeviceFamily -#define SDL_GetWinRTFSPathUTF8 SDL_GetWinRTFSPathUTF8_renamed_SDL_GetWinRTFSPath #define SDL_iOSSetAnimationCallback SDL_iOSSetAnimationCallback_renamed_SDL_SetiOSAnimationCallback #define SDL_iOSSetEventPump SDL_iOSSetEventPump_renamed_SDL_SetiOSEventPump #define SDL_iPhoneSetAnimationCallback SDL_iPhoneSetAnimationCallback_renamed_SDL_iOSSetAnimationCallback diff --git a/include/SDL3/SDL_platform_defines.h b/include/SDL3/SDL_platform_defines.h index e7f91cf94..ea717cc8d 100644 --- a/include/SDL3/SDL_platform_defines.h +++ b/include/SDL3/SDL_platform_defines.h @@ -173,7 +173,7 @@ #endif #if WINAPI_FAMILY_WINRT -#define SDL_PLATFORM_WINRT 1 +#error Windows RT/UWP is no longer supported in SDL #elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */ #define SDL_PLATFORM_WINGDK 1 #elif defined(_GAMING_XBOX_XBOXONE) diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 17ac0a105..789da2846 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -559,90 +559,6 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int #endif /* SDL_PLATFORM_ANDROID */ -/* - * Platform specific functions for WinRT - */ -#ifdef SDL_PLATFORM_WINRT - -/** - * WinRT / Windows Phone path types - * - * \since This enum is available since SDL 3.0.0. - */ -typedef enum SDL_WinRT_Path -{ - /** The installed app's root directory. - Files here are likely to be read-only. */ - SDL_WINRT_PATH_INSTALLED_LOCATION, - - /** The app's local data store. Files may be written here */ - SDL_WINRT_PATH_LOCAL_FOLDER, - - /** The app's roaming data store. Unsupported on Windows Phone. - Files written here may be copied to other machines via a network - connection. - */ - SDL_WINRT_PATH_ROAMING_FOLDER, - - /** The app's temporary data store. Unsupported on Windows Phone. - Files written here may be deleted at any time. */ - SDL_WINRT_PATH_TEMP_FOLDER -} SDL_WinRT_Path; - - -/** - * WinRT Device Family - * - * \since This enum is available since SDL 3.0.0. - */ -typedef enum SDL_WinRT_DeviceFamily -{ - /** Unknown family */ - SDL_WINRT_DEVICEFAMILY_UNKNOWN, - - /** Desktop family*/ - SDL_WINRT_DEVICEFAMILY_DESKTOP, - - /** Mobile family (for example smartphone) */ - SDL_WINRT_DEVICEFAMILY_MOBILE, - - /** XBox family */ - SDL_WINRT_DEVICEFAMILY_XBOX, -} SDL_WinRT_DeviceFamily; - - -/** - * Retrieve a WinRT defined path on the local file system. - * - * Not all paths are available on all versions of Windows. This is especially - * true on Windows Phone. Check the documentation for the given SDL_WinRT_Path - * for more information on which path types are supported where. - * - * Documentation on most app-specific path types on WinRT can be found on - * MSDN, at the URL: - * - * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx - * - * \param pathType the type of path to retrieve, one of SDL_WinRT_Path. - * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if - * the path is not available for any reason; call SDL_GetError() for - * more information. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetWinRTFSPath(SDL_WinRT_Path pathType); - -/** - * Detects the device family of WinRT platform at runtime. - * - * \returns a value from the SDL_WinRT_DeviceFamily enum. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_GetWinRTDeviceFamily(); - -#endif /* SDL_PLATFORM_WINRT */ - /** * Query if the current device is a tablet. * diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index 0fdc8a027..4a613efbf 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -36,7 +36,7 @@ #include #include -#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && !defined(SDL_PLATFORM_WINRT) +#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) #include /* _beginthreadex() and _endthreadex() */ #endif @@ -263,7 +263,7 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_Prop /* The real implementation, hidden from the wiki, so it can show this as real functions that don't have macro magic. */ #ifndef SDL_WIKI_DOCUMENTATION_SECTION -# if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && !defined(SDL_PLATFORM_WINRT) +# if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) # ifndef SDL_BeginThreadFunction # define SDL_BeginThreadFunction _beginthreadex # endif diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index e4d57c5d7..27f9fddab 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -1215,11 +1215,6 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowParent(SDL_Window *window) * - `SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER`: the EGLSurface associated with * the window * - * On UWP: - * - * - `SDL_PROP_WINDOW_WINRT_WINDOW_POINTER`: the IInspectable CoreWindow - * associated with the window - * * On Windows: * * - `SDL_PROP_WINDOW_WIN32_HWND_POINTER`: the HWND associated with the window @@ -1286,7 +1281,6 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window #define SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER "SDL.window.vivante.display" #define SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER "SDL.window.vivante.window" #define SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER "SDL.window.vivante.surface" -#define SDL_PROP_WINDOW_WINRT_WINDOW_POINTER "SDL.window.winrt.window" #define SDL_PROP_WINDOW_WIN32_HWND_POINTER "SDL.window.win32.hwnd" #define SDL_PROP_WINDOW_WIN32_HDC_POINTER "SDL.window.win32.hdc" #define SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER "SDL.window.win32.instance" diff --git a/include/build_config/SDL_build_config.h b/include/build_config/SDL_build_config.h index beaceb584..eca4268cb 100644 --- a/include/build_config/SDL_build_config.h +++ b/include/build_config/SDL_build_config.h @@ -33,8 +33,6 @@ /* Add any platform that doesn't build using the configure system. */ #if defined(SDL_PLATFORM_WIN32) #include "SDL_build_config_windows.h" -#elif defined(SDL_PLATFORM_WINRT) -#include "SDL_build_config_winrt.h" #elif defined(SDL_PLATFORM_WINGDK) #include "SDL_build_config_wingdk.h" #elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) diff --git a/include/build_config/SDL_build_config.h.cmake b/include/build_config/SDL_build_config.h.cmake index e117409bb..c8732f748 100644 --- a/include/build_config/SDL_build_config.h.cmake +++ b/include/build_config/SDL_build_config.h.cmake @@ -396,7 +396,6 @@ #cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR@ #cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@ #cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@ -#cmakedefine SDL_VIDEO_DRIVER_WINRT @SDL_VIDEO_DRIVER_WINRT@ #cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@ @@ -457,7 +456,6 @@ #cmakedefine SDL_POWER_ANDROID @SDL_POWER_ANDROID@ #cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ #cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ -#cmakedefine SDL_POWER_WINRT @SDL_POWER_WINRT@ #cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ #cmakedefine SDL_POWER_UIKIT @SDL_POWER_UIKIT@ #cmakedefine SDL_POWER_HAIKU @SDL_POWER_HAIKU@ diff --git a/include/build_config/SDL_build_config_windows.h b/include/build_config/SDL_build_config_windows.h index 772952196..a64d1d2dd 100644 --- a/include/build_config/SDL_build_config_windows.h +++ b/include/build_config/SDL_build_config_windows.h @@ -242,9 +242,7 @@ typedef unsigned int uintptr_t; #define SDL_JOYSTICK_GAMEINPUT 1 #endif #define SDL_JOYSTICK_HIDAPI 1 -#ifndef SDL_PLATFORM_WINRT #define SDL_JOYSTICK_RAWINPUT 1 -#endif #define SDL_JOYSTICK_VIRTUAL 1 #ifdef HAVE_WINDOWS_GAMING_INPUT_H #define SDL_JOYSTICK_WGI 1 diff --git a/include/build_config/SDL_build_config_winrt.h b/include/build_config/SDL_build_config_winrt.h deleted file mode 100644 index 7ee64a66f..000000000 --- a/include/build_config/SDL_build_config_winrt.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#ifndef SDL_build_config_winrt_h_ -#define SDL_build_config_winrt_h_ -#define SDL_build_config_h_ - -#include - -/* Make sure the Windows SDK's NTDDI_VERSION macro gets defined. This is used - by SDL to determine which version of the Windows SDK is being used. -*/ -#include - -/* Define possibly-undefined NTDDI values (used when compiling SDL against - older versions of the Windows SDK. -*/ -#ifndef NTDDI_WINBLUE -#define NTDDI_WINBLUE 0x06030000 -#endif -#ifndef NTDDI_WIN10 -#define NTDDI_WIN10 0x0A000000 -#endif - -/* This is a set of defines to configure the SDL features */ - -#ifdef __clang__ -# define HAVE_GCC_ATOMICS 1 -#endif - -/* Useful headers */ -#define HAVE_DXGI_H 1 -#if !SDL_WINAPI_FAMILY_PHONE -#define HAVE_XINPUT_H 1 -#endif - -#define HAVE_MMDEVICEAPI_H 1 -#define HAVE_AUDIOCLIENT_H 1 -#define HAVE_TPCSHRD_H 1 - -#define HAVE_LIBC 1 -#define HAVE_FLOAT_H 1 -#define HAVE_LIMITS_H 1 -#define HAVE_MATH_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDBOOL_H 1 -#define HAVE_STDDEF_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDIO_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_WCHAR_H 1 - -/* C library functions */ -#define HAVE_LIBC 1 -#define HAVE_MALLOC 1 -#define HAVE_CALLOC 1 -#define HAVE_REALLOC 1 -#define HAVE_FREE 1 -#define HAVE_ABS 1 -#define HAVE_MEMSET 1 -#define HAVE_MEMCPY 1 -#define HAVE_MEMMOVE 1 -#define HAVE_MEMCMP 1 -#define HAVE_STRLEN 1 -#define HAVE__STRREV 1 -#define HAVE__STRUPR 1 -#define HAVE_STRCHR 1 -#define HAVE_STRPBRK 1 -#define HAVE_STRRCHR 1 -#define HAVE_STRSTR 1 -#define HAVE_STRTOL 1 -#define HAVE_STRTOUL 1 -/* #undef HAVE_STRTOLL */ -/* #undef HAVE_STRTOULL */ -#define HAVE_STRTOD 1 -#define HAVE_ATOI 1 -#define HAVE_ATOF 1 -#define HAVE_STRCMP 1 -#define HAVE_STRNCMP 1 -#define HAVE_VSNPRINTF 1 -/* TODO, WinRT: consider using ??_s versions of the following */ -/* #undef HAVE__STRLWR */ -/* #undef HAVE_ITOA */ -/* #undef HAVE__LTOA */ -/* #undef HAVE__ULTOA */ -/* #undef HAVE_SSCANF */ -#define HAVE_ACOS 1 -#define HAVE_ACOSF 1 -#define HAVE_ASIN 1 -#define HAVE_ASINF 1 -#define HAVE_ATAN 1 -#define HAVE_ATANF 1 -#define HAVE_ATAN2 1 -#define HAVE_ATAN2F 1 -#define HAVE_CEIL 1 -#define HAVE_CEILF 1 -#define HAVE__COPYSIGN 1 -#define HAVE_COS 1 -#define HAVE_COSF 1 -#define HAVE_EXP 1 -#define HAVE_EXPF 1 -#define HAVE_FABS 1 -#define HAVE_FABSF 1 -#define HAVE_FLOOR 1 -#define HAVE_FLOORF 1 -#define HAVE_FMOD 1 -#define HAVE_FMODF 1 -#define HAVE_ISINF 1 -#define HAVE_ISINF_FLOAT_MACRO 1 -#define HAVE_ISNAN 1 -#define HAVE_ISNAN_FLOAT_MACRO 1 -#define HAVE_LOG 1 -#define HAVE_LOGF 1 -#define HAVE_LOG10 1 -#define HAVE_LOG10F 1 -#define HAVE_LROUND 1 -#define HAVE_LROUNDF 1 -#define HAVE_MODF 1 -#define HAVE_MODFF 1 -#define HAVE_POW 1 -#define HAVE_POWF 1 -#define HAVE_ROUND 1 -#define HAVE_ROUNDF 1 -#define HAVE__SCALB 1 -#define HAVE_SIN 1 -#define HAVE_SINF 1 -#define HAVE_SQRT 1 -#define HAVE_SQRTF 1 -#define HAVE_TAN 1 -#define HAVE_TANF 1 -#define HAVE_TRUNC 1 -#define HAVE_TRUNCF 1 -#define HAVE__FSEEKI64 1 - -#define HAVE_ROAPI_H 1 - -/* Enable various audio drivers */ -#define SDL_AUDIO_DRIVER_WASAPI 1 -#define SDL_AUDIO_DRIVER_DISK 1 -#define SDL_AUDIO_DRIVER_DUMMY 1 - -/* Enable various input drivers */ -#if SDL_WINAPI_FAMILY_PHONE -#define SDL_JOYSTICK_DISABLED 1 -#define SDL_HAPTIC_DISABLED 1 -#else -#define SDL_JOYSTICK_VIRTUAL 1 -#if (NTDDI_VERSION >= NTDDI_WIN10) -#define SDL_JOYSTICK_WGI 1 -#define SDL_HAPTIC_DISABLED 1 -#else -#define SDL_JOYSTICK_XINPUT 1 -#endif /* WIN10 */ -#endif - -/* WinRT doesn't have HIDAPI available */ -#define SDL_HIDAPI_DISABLED 1 - -/* Enable the dummy sensor driver */ -#define SDL_SENSOR_DUMMY 1 - -/* Enable various shared object loading systems */ -#define SDL_LOADSO_WINDOWS 1 - -/* Enable various threading systems */ -#if (NTDDI_VERSION >= NTDDI_WINBLUE) -#define SDL_THREAD_GENERIC_COND_SUFFIX 1 -#define SDL_THREAD_GENERIC_RWLOCK_SUFFIX 1 -#define SDL_THREAD_WINDOWS 1 -#else -/* WinRT on Windows 8.0 and Windows Phone 8.0 don't support CreateThread() */ -#define SDL_THREAD_STDCPP 1 -#endif - -/* Enable RTC system */ -#define SDL_TIME_WINDOWS 1 - -/* Enable various timer systems */ -#define SDL_TIMER_WINDOWS 1 - -/* Enable various video drivers */ -#define SDL_VIDEO_DRIVER_WINRT 1 -#define SDL_VIDEO_DRIVER_DUMMY 1 - -/* Enable OpenGL ES 2.0 (via a modified ANGLE library) */ -#define SDL_VIDEO_OPENGL_ES2 1 -#define SDL_VIDEO_OPENGL_EGL 1 - -/* Enable appropriate renderer(s) */ -#define SDL_VIDEO_RENDER_D3D11 1 - -/* Disable D3D12 as it's not implemented for WinRT */ -/* #undef SDL_VIDEO_RENDER_D3D12 */ - -#ifdef SDL_VIDEO_OPENGL_ES2 -#define SDL_VIDEO_RENDER_OGL_ES2 1 -#endif - -/* Enable system power support */ -#define SDL_POWER_WINRT 1 - -/* Enable filesystem support */ -#define SDL_FILESYSTEM_WINDOWS 1 -#define SDL_FSOPS_WINDOWS 1 - -/* Enable the camera driver (src/camera/dummy/\*.c) */ /* !!! FIXME */ -#define SDL_CAMERA_DRIVER_DUMMY 1 - -#endif /* SDL_build_config_winrt_h_ */ diff --git a/src/SDL.c b/src/SDL.c index ef1d815d4..85308b2d2 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -23,7 +23,7 @@ #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) #include "core/windows/SDL_windows.h" -#elif !defined(SDL_PLATFORM_WINRT) +#else #include // _exit(), etc. #endif @@ -694,8 +694,6 @@ const char *SDL_GetPlatform(void) return "Solaris"; #elif defined(SDL_PLATFORM_WIN32) return "Windows"; -#elif defined(SDL_PLATFORM_WINRT) - return "WinRT"; #elif defined(SDL_PLATFORM_WINGDK) return "WinGDK"; #elif defined(SDL_PLATFORM_XBOXONE) diff --git a/src/SDL_log.c b/src/SDL_log.c index 17e3ed964..016175ecb 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -20,7 +20,7 @@ */ #include "SDL_internal.h" -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) #include "core/windows/SDL_windows.h" #endif @@ -511,7 +511,7 @@ void SDL_LogMessageV(int category, SDL_LogPriority priority, SDL_PRINTF_FORMAT_S } } -#if defined(SDL_PLATFORM_WIN32) && !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK) +#if defined(SDL_PLATFORM_WIN32) && !defined(SDL_PLATFORM_GDK) enum { CONSOLE_UNATTACHED = 0, CONSOLE_ATTACHED_CONSOLE = 1, @@ -526,7 +526,7 @@ static HANDLE stderrHandle = NULL; static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, const char *message) { -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) // Way too many allocations here, urgh // Note: One can't call SDL_SetError here, since that function itself logs. { @@ -535,7 +535,7 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority LPTSTR tstr; bool isstack; -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK) +#if !defined(SDL_PLATFORM_GDK) BOOL attachResult; DWORD attachError; DWORD consoleMode; @@ -574,7 +574,7 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority } } } -#endif // !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK) +#endif // !defined(SDL_PLATFORM_GDK) length = SDL_strlen(SDL_GetLogPriorityPrefix(priority)) + SDL_strlen(message) + 1 + 1 + 1; output = SDL_small_alloc(char, length, &isstack); (void)SDL_snprintf(output, length, "%s%s\r\n", SDL_GetLogPriorityPrefix(priority), message); @@ -583,7 +583,7 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority // Output to debugger OutputDebugString(tstr); -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK) +#if !defined(SDL_PLATFORM_GDK) // Screen output to stderr, if console was attached. if (consoleAttached == CONSOLE_ATTACHED_CONSOLE) { if (!WriteConsole(stderrHandle, tstr, (DWORD)SDL_tcslen(tstr), &charsWritten, NULL)) { @@ -598,7 +598,7 @@ static void SDLCALL SDL_LogOutput(void *userdata, int category, SDL_LogPriority OutputDebugString(TEXT("Error calling WriteFile\r\n")); } } -#endif // !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_GDK) +#endif // !defined(SDL_PLATFORM_GDK) SDL_free(tstr); SDL_small_free(output, isstack); diff --git a/src/atomic/SDL_spinlock.c b/src/atomic/SDL_spinlock.c index 3ca84476b..6186443da 100644 --- a/src/atomic/SDL_spinlock.c +++ b/src/atomic/SDL_spinlock.c @@ -20,7 +20,7 @@ */ #include "SDL_internal.h" -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) #include "../core/windows/SDL_windows.h" #endif diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index cf3b86b0a..9eaa32e87 100644 --- a/src/audio/wasapi/SDL_wasapi.c +++ b/src/audio/wasapi/SDL_wasapi.c @@ -325,12 +325,6 @@ static bool mgmtthrtask_CoTaskMemFree(void *userdata) return true; } -static bool mgmtthrtask_PlatformDeleteActivationHandler(void *userdata) -{ - WASAPI_PlatformDeleteActivationHandler(userdata); - return true; -} - static bool mgmtthrtask_CloseHandle(void *userdata) { CloseHandle((HANDLE) userdata); @@ -370,12 +364,6 @@ static void ResetWasapiDevice(SDL_AudioDevice *device) WASAPI_ProxyToManagementThread(mgmtthrtask_CoTaskMemFree, ptr, NULL); } - if (device->hidden->activation_handler) { - void *activation_handler = device->hidden->activation_handler; - device->hidden->activation_handler = NULL; - WASAPI_ProxyToManagementThread(mgmtthrtask_PlatformDeleteActivationHandler, activation_handler, NULL); - } - if (device->hidden->event) { HANDLE event = device->hidden->event; device->hidden->event = NULL; @@ -592,7 +580,7 @@ static bool mgmtthrtask_PrepDevice(void *userdata) IAudioClient *client = device->hidden->client; SDL_assert(client != NULL); -#if defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) // CreateEventEx() arrived in Vista, so we need an #ifdef for XP. +#if defined(SDL_PLATFORM_GDK) // CreateEventEx() arrived in Vista, so we need an #ifdef for XP. device->hidden->event = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS); #else device->hidden->event = CreateEventW(NULL, 0, 0, NULL); diff --git a/src/audio/wasapi/SDL_wasapi.h b/src/audio/wasapi/SDL_wasapi.h index 107ddb53a..3d4744cf1 100644 --- a/src/audio/wasapi/SDL_wasapi.h +++ b/src/audio/wasapi/SDL_wasapi.h @@ -42,10 +42,9 @@ struct SDL_PrivateAudioData int framesize; bool device_lost; bool device_dead; - void *activation_handler; }; -// win32 and winrt implementations call into these. +// win32 implementation calls into these. bool WASAPI_PrepDevice(SDL_AudioDevice *device); void WASAPI_DisconnectDevice(SDL_AudioDevice *device); // don't hold the device lock when calling this! @@ -54,7 +53,7 @@ void WASAPI_DisconnectDevice(SDL_AudioDevice *device); // don't hold the device typedef bool (*ManagementThreadTask)(void *userdata); bool WASAPI_ProxyToManagementThread(ManagementThreadTask task, void *userdata, bool *wait_until_complete); -// These are functions that are implemented differently for Windows vs WinRT. +// These are functions that are (were...?) implemented differently for various Windows versions. // UNLESS OTHERWISE NOTED THESE ALL HAPPEN ON THE MANAGEMENT THREAD. bool WASAPI_PlatformInit(void); void WASAPI_PlatformDeinit(void); @@ -63,7 +62,6 @@ void WASAPI_EnumerateEndpoints(SDL_AudioDevice **default_playback, SDL_AudioDevi bool WASAPI_ActivateDevice(SDL_AudioDevice *device); void WASAPI_PlatformThreadInit(SDL_AudioDevice *device); // this happens on the audio device thread, not the management thread. void WASAPI_PlatformThreadDeinit(SDL_AudioDevice *device); // this happens on the audio device thread, not the management thread. -void WASAPI_PlatformDeleteActivationHandler(void *handler); void WASAPI_PlatformFreeDeviceHandle(SDL_AudioDevice *device); #ifdef __cplusplus diff --git a/src/audio/wasapi/SDL_wasapi_win32.c b/src/audio/wasapi/SDL_wasapi_win32.c index e548c9994..cd13115f2 100644 --- a/src/audio/wasapi/SDL_wasapi_win32.c +++ b/src/audio/wasapi/SDL_wasapi_win32.c @@ -20,13 +20,14 @@ */ #include "SDL_internal.h" -/* This is code that Windows uses to talk to WASAPI-related system APIs. +/* !!! FIXME: merge this all into SDL_wasapi.c, now that WinRT is gone. + This is code that Windows uses to talk to WASAPI-related system APIs. This is for non-WinRT desktop apps. The C++/CX implementation of these functions, exclusive to WinRT, are in SDL_wasapi_winrt.cpp. The code in SDL_wasapi.c is used by both standard Windows and WinRT builds to deal with audio and calls into these functions. */ -#if defined(SDL_AUDIO_DRIVER_WASAPI) && !defined(SDL_PLATFORM_WINRT) +#if defined(SDL_AUDIO_DRIVER_WASAPI) #include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_immdevice.h" @@ -191,15 +192,9 @@ void WASAPI_EnumerateEndpoints(SDL_AudioDevice **default_playback, SDL_AudioDevi SDL_IMMDevice_EnumerateEndpoints(default_playback, default_recording); } -void WASAPI_PlatformDeleteActivationHandler(void *handler) -{ - // not asynchronous. - SDL_assert(!"This function should have only been called on WinRT."); -} - void WASAPI_PlatformFreeDeviceHandle(SDL_AudioDevice *device) { SDL_IMMDevice_FreeDeviceHandle(device); } -#endif // SDL_AUDIO_DRIVER_WASAPI && !defined(SDL_PLATFORM_WINRT) +#endif // SDL_AUDIO_DRIVER_WASAPI diff --git a/src/audio/wasapi/SDL_wasapi_winrt.cpp b/src/audio/wasapi/SDL_wasapi_winrt.cpp deleted file mode 100644 index 4b27df296..000000000 --- a/src/audio/wasapi/SDL_wasapi_winrt.cpp +++ /dev/null @@ -1,360 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -// This is C++/CX code that the WinRT port uses to talk to WASAPI-related -// system APIs. The C implementation of these functions, for non-WinRT apps, -// is in SDL_wasapi_win32.c. The code in SDL_wasapi.c is used by both standard -// Windows and WinRT builds to deal with audio and calls into these functions. - -#if defined(SDL_AUDIO_DRIVER_WASAPI) && defined(SDL_PLATFORM_WINRT) - -#include -#include -#include -#include -#include -#include - -extern "C" { -#include "../../core/windows/SDL_windows.h" -#include "../SDL_sysaudio.h" -} - -#define COBJMACROS -#include -#include - -#include "SDL_wasapi.h" - -using namespace Windows::Devices::Enumeration; -using namespace Windows::Media::Devices; -using namespace Windows::Foundation; -using namespace Microsoft::WRL; - -static Platform::String ^ SDL_PKEY_AudioEngine_DeviceFormat = L"{f19f064d-082c-4e27-bc73-6882a1bb8e4c} 0"; - - -static bool FindWinRTAudioDeviceCallback(SDL_AudioDevice *device, void *userdata) -{ - return (SDL_wcscmp((LPCWSTR) device->handle, (LPCWSTR) userdata) == 0); -} - -static SDL_AudioDevice *FindWinRTAudioDevice(LPCWSTR devid) -{ - return SDL_FindPhysicalAudioDeviceByCallback(FindWinRTAudioDeviceCallback, (void *) devid); -} - -class SDL_WasapiDeviceEventHandler -{ - public: - SDL_WasapiDeviceEventHandler(const bool _recording); - ~SDL_WasapiDeviceEventHandler(); - void OnDeviceAdded(DeviceWatcher ^ sender, DeviceInformation ^ args); - void OnDeviceRemoved(DeviceWatcher ^ sender, DeviceInformationUpdate ^ args); - void OnDeviceUpdated(DeviceWatcher ^ sender, DeviceInformationUpdate ^ args); - void OnEnumerationCompleted(DeviceWatcher ^ sender, Platform::Object ^ args); - void OnDefaultRenderDeviceChanged(Platform::Object ^ sender, DefaultAudioRenderDeviceChangedEventArgs ^ args); - void OnDefaultCaptureDeviceChanged(Platform::Object ^ sender, DefaultAudioCaptureDeviceChangedEventArgs ^ args); - void WaitForCompletion(); - - private: - SDL_Semaphore *completed_semaphore; - const bool recording; - DeviceWatcher ^ watcher; - Windows::Foundation::EventRegistrationToken added_handler; - Windows::Foundation::EventRegistrationToken removed_handler; - Windows::Foundation::EventRegistrationToken updated_handler; - Windows::Foundation::EventRegistrationToken completed_handler; - Windows::Foundation::EventRegistrationToken default_changed_handler; -}; - -SDL_WasapiDeviceEventHandler::SDL_WasapiDeviceEventHandler(const bool _recording) - : recording(_recording), completed_semaphore(SDL_CreateSemaphore(0)) -{ - if (!completed_semaphore) { - return; // uhoh. - } - - Platform::String ^ selector = _recording ? MediaDevice::GetAudioCaptureSelector() : MediaDevice::GetAudioRenderSelector(); - Platform::Collections::Vector properties; - properties.Append(SDL_PKEY_AudioEngine_DeviceFormat); - watcher = DeviceInformation::CreateWatcher(selector, properties.GetView()); - if (!watcher) - return; // uhoh. - - // !!! FIXME: this doesn't need a lambda here, I think, if I make SDL_WasapiDeviceEventHandler a proper C++/CX class. --ryan. - added_handler = watcher->Added += ref new TypedEventHandler([this](DeviceWatcher ^ sender, DeviceInformation ^ args) { OnDeviceAdded(sender, args); }); - removed_handler = watcher->Removed += ref new TypedEventHandler([this](DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) { OnDeviceRemoved(sender, args); }); - updated_handler = watcher->Updated += ref new TypedEventHandler([this](DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) { OnDeviceUpdated(sender, args); }); - completed_handler = watcher->EnumerationCompleted += ref new TypedEventHandler([this](DeviceWatcher ^ sender, Platform::Object ^ args) { OnEnumerationCompleted(sender, args); }); - if (recording) { - default_changed_handler = MediaDevice::DefaultAudioCaptureDeviceChanged += ref new TypedEventHandler([this](Platform::Object ^ sender, DefaultAudioCaptureDeviceChangedEventArgs ^ args) { OnDefaultCaptureDeviceChanged(sender, args); }); - } else { - default_changed_handler = MediaDevice::DefaultAudioRenderDeviceChanged += ref new TypedEventHandler([this](Platform::Object ^ sender, DefaultAudioRenderDeviceChangedEventArgs ^ args) { OnDefaultRenderDeviceChanged(sender, args); }); - } - watcher->Start(); -} - -SDL_WasapiDeviceEventHandler::~SDL_WasapiDeviceEventHandler() -{ - if (watcher) { - watcher->Added -= added_handler; - watcher->Removed -= removed_handler; - watcher->Updated -= updated_handler; - watcher->EnumerationCompleted -= completed_handler; - watcher->Stop(); - watcher = nullptr; - } - - if (completed_semaphore) { - SDL_DestroySemaphore(completed_semaphore); - completed_semaphore = nullptr; - } - - if (recording) { - MediaDevice::DefaultAudioCaptureDeviceChanged -= default_changed_handler; - } else { - MediaDevice::DefaultAudioRenderDeviceChanged -= default_changed_handler; - } -} - -void SDL_WasapiDeviceEventHandler::OnDeviceAdded(DeviceWatcher ^ sender, DeviceInformation ^ info) -{ - /* You can have multiple endpoints on a device that are mutually exclusive ("Speakers" vs "Line Out" or whatever). - In a perfect world, things that are unplugged won't be in this collection. The only gotcha is probably for - phones and tablets, where you might have an internal speaker and a headphone jack and expect both to be - available and switch automatically. (!!! FIXME...?) */ - - SDL_assert(sender == this->watcher); - char *utf8dev = WIN_StringToUTF8W(info->Name->Data()); - if (utf8dev) { - SDL_AudioSpec spec; - SDL_zero(spec); - - Platform::Object ^ obj = info->Properties->Lookup(SDL_PKEY_AudioEngine_DeviceFormat); - if (obj) { - IPropertyValue ^ property = (IPropertyValue ^) obj; - Platform::Array ^ data; - property->GetUInt8Array(&data); - WAVEFORMATEXTENSIBLE fmt; - SDL_zero(fmt); - SDL_memcpy(&fmt, data->Data, SDL_min(data->Length, sizeof(WAVEFORMATEXTENSIBLE))); - spec.channels = (Uint8)fmt.Format.nChannels; - spec.freq = fmt.Format.nSamplesPerSec; - spec.format = SDL_WaveFormatExToSDLFormat((WAVEFORMATEX *)&fmt); - } - - LPWSTR devid = SDL_wcsdup(info->Id->Data()); - if (devid) { - SDL_AddAudioDevice(this->recording, utf8dev, spec.channels ? &spec : NULL, devid); - } - SDL_free(utf8dev); - } -} - -void SDL_WasapiDeviceEventHandler::OnDeviceRemoved(DeviceWatcher ^ sender, DeviceInformationUpdate ^ info) -{ - SDL_assert(sender == this->watcher); - WASAPI_DisconnectDevice(FindWinRTAudioDevice(info->Id->Data())); -} - -void SDL_WasapiDeviceEventHandler::OnDeviceUpdated(DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) -{ - SDL_assert(sender == this->watcher); -} - -void SDL_WasapiDeviceEventHandler::OnEnumerationCompleted(DeviceWatcher ^ sender, Platform::Object ^ args) -{ - SDL_assert(sender == this->watcher); - if (this->completed_semaphore) { - SDL_SignalSemaphore(this->completed_semaphore); - } -} - -void SDL_WasapiDeviceEventHandler::OnDefaultRenderDeviceChanged(Platform::Object ^ sender, DefaultAudioRenderDeviceChangedEventArgs ^ args) -{ - SDL_assert(!this->recording); - SDL_DefaultAudioDeviceChanged(FindWinRTAudioDevice(args->Id->Data())); -} - -void SDL_WasapiDeviceEventHandler::OnDefaultCaptureDeviceChanged(Platform::Object ^ sender, DefaultAudioCaptureDeviceChangedEventArgs ^ args) -{ - SDL_assert(this->recording); - SDL_DefaultAudioDeviceChanged(FindWinRTAudioDevice(args->Id->Data())); -} - -void SDL_WasapiDeviceEventHandler::WaitForCompletion() -{ - if (this->completed_semaphore) { - SDL_WaitSemaphore(this->completed_semaphore); - SDL_DestroySemaphore(this->completed_semaphore); - this->completed_semaphore = nullptr; - } -} - -static SDL_WasapiDeviceEventHandler *playback_device_event_handler; -static SDL_WasapiDeviceEventHandler *recording_device_event_handler; - -bool WASAPI_PlatformInit(void) -{ - return true; -} - -static void StopWasapiHotplug(void) -{ - delete playback_device_event_handler; - playback_device_event_handler = nullptr; - delete recording_device_event_handler; - recording_device_event_handler = nullptr; -} - -void WASAPI_PlatformDeinit(void) -{ - StopWasapiHotplug(); -} - -void WASAPI_PlatformDeinitializeStart(void) -{ - StopWasapiHotplug(); -} - - -void WASAPI_EnumerateEndpoints(SDL_AudioDevice **default_playback, SDL_AudioDevice **default_recording) -{ - Platform::String ^ defdevid; - - // DeviceWatchers will fire an Added event for each existing device at - // startup, so we don't need to enumerate them separately before - // listening for updates. - playback_device_event_handler = new SDL_WasapiDeviceEventHandler(false); - playback_device_event_handler->WaitForCompletion(); - defdevid = MediaDevice::GetDefaultAudioRenderId(AudioDeviceRole::Default); - if (defdevid) { - *default_playback = FindWinRTAudioDevice(defdevid->Data()); - } - - recording_device_event_handler = new SDL_WasapiDeviceEventHandler(true); - recording_device_event_handler->WaitForCompletion(); - defdevid = MediaDevice::GetDefaultAudioCaptureId(AudioDeviceRole::Default); - if (defdevid) { - *default_recording = FindWinRTAudioDevice(defdevid->Data()); - } -} - -class SDL_WasapiActivationHandler : public RuntimeClass, FtmBase, IActivateAudioInterfaceCompletionHandler> -{ -public: - SDL_WasapiActivationHandler() : completion_semaphore(SDL_CreateSemaphore(0)) { SDL_assert(completion_semaphore != NULL); } - STDMETHOD(ActivateCompleted)(IActivateAudioInterfaceAsyncOperation *operation); - void WaitForCompletion(); -private: - SDL_Semaphore *completion_semaphore; -}; - -void SDL_WasapiActivationHandler::WaitForCompletion() -{ - if (completion_semaphore) { - SDL_WaitSemaphore(completion_semaphore); - SDL_DestroySemaphore(completion_semaphore); - completion_semaphore = NULL; - } -} - -HRESULT -SDL_WasapiActivationHandler::ActivateCompleted(IActivateAudioInterfaceAsyncOperation *async) -{ - // Just set a flag, since we're probably in a different thread. We'll pick it up and init everything on our own thread to prevent races. - SDL_SignalSemaphore(completion_semaphore); - return S_OK; -} - -void WASAPI_PlatformDeleteActivationHandler(void *handler) -{ - ((SDL_WasapiActivationHandler *)handler)->Release(); -} - -bool WASAPI_ActivateDevice(SDL_AudioDevice *device) -{ - LPCWSTR devid = (LPCWSTR) device->handle; - SDL_assert(devid != NULL); - - ComPtr handler = Make(); - if (handler == nullptr) { - return SDL_SetError("Failed to allocate WASAPI activation handler"); - } - - handler.Get()->AddRef(); // we hold a reference after ComPtr destructs on return, causing a Release, and Release ourselves in WASAPI_PlatformDeleteActivationHandler(), etc. - device->hidden->activation_handler = handler.Get(); - - IActivateAudioInterfaceAsyncOperation *async = nullptr; - const HRESULT ret = ActivateAudioInterfaceAsync(devid, __uuidof(IAudioClient), nullptr, handler.Get(), &async); - - if (FAILED(ret) || async == nullptr) { - if (async != nullptr) { - async->Release(); - } - handler.Get()->Release(); - return WIN_SetErrorFromHRESULT("WASAPI can't activate requested audio endpoint", ret); - } - - // !!! FIXME: the problems in SDL2 that needed this to be synchronous are _probably_ solved by SDL3, and this can block indefinitely if a user prompt is shown to get permission to use a microphone. - handler.Get()->WaitForCompletion(); // block here until we have an answer, so this is synchronous to us after all. - - HRESULT activateRes = S_OK; - IUnknown *iunknown = nullptr; - const HRESULT getActivateRes = async->GetActivateResult(&activateRes, &iunknown); - async->Release(); - if (FAILED(getActivateRes)) { - return WIN_SetErrorFromHRESULT("Failed to get WASAPI activate result", getActivateRes); - } else if (FAILED(activateRes)) { - return WIN_SetErrorFromHRESULT("Failed to activate WASAPI device", activateRes); - } - - iunknown->QueryInterface(IID_PPV_ARGS(&device->hidden->client)); - if (!device->hidden->client) { - return SDL_SetError("Failed to query WASAPI client interface"); - } - - if (!WASAPI_PrepDevice(device)) { - return false; - } - - return true; -} - -void WASAPI_PlatformThreadInit(SDL_AudioDevice *device) -{ - // !!! FIXME: set this thread to "Pro Audio" priority. - SDL_SetThreadPriority(device->recording ? SDL_THREAD_PRIORITY_HIGH : SDL_THREAD_PRIORITY_TIME_CRITICAL); -} - -void WASAPI_PlatformThreadDeinit(SDL_AudioDevice *device) -{ - // !!! FIXME: set this thread to "Pro Audio" priority. -} - -void WASAPI_PlatformFreeDeviceHandle(SDL_AudioDevice *device) -{ - SDL_free(device->handle); -} - -#endif // SDL_AUDIO_DRIVER_WASAPI && defined(SDL_PLATFORM_WINRT) diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index daa2c40f2..81681502b 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -76,7 +76,7 @@ void SDL_GDKResumeGPU(SDL_GPUDevice *device) #endif -#if !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK)) +#if !(defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst); SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst) @@ -103,25 +103,6 @@ void SDL_UnregisterApp(void) #endif -#ifndef SDL_PLATFORM_WINRT - -// Returns SDL_WinRT_DeviceFamily enum -SDL_DECLSPEC int SDLCALL SDL_GetWinRTDeviceFamily(void); -int SDL_GetWinRTDeviceFamily(void) -{ - SDL_Unsupported(); - return 0; // SDL_WINRT_DEVICEFAMILY_UNKNOWN -} - -SDL_DECLSPEC const char *SDLCALL SDL_GetWinRTFSPath(int pathType); // SDL_WinRT_Path pathType -const char *SDL_GetWinRTFSPath(int pathType) -{ - (void)pathType; - SDL_Unsupported(); - return NULL; -} -#endif - #ifndef SDL_PLATFORM_ANDROID SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); diff --git a/src/core/windows/SDL_hid.c b/src/core/windows/SDL_hid.c index 2758b633f..419cb7270 100644 --- a/src/core/windows/SDL_hid.c +++ b/src/core/windows/SDL_hid.c @@ -20,8 +20,6 @@ */ #include "SDL_internal.h" -#ifndef SDL_PLATFORM_WINRT - #include "SDL_hid.h" HidD_GetString_t SDL_HidD_GetManufacturerString; @@ -82,9 +80,7 @@ void WIN_UnloadHIDDLL(void) } } -#endif // !SDL_PLATFORM_WINRT - -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) // CM_Register_Notification definitions @@ -253,4 +249,4 @@ void WIN_QuitDeviceNotification(void) { } -#endif // !SDL_PLATFORM_WINRT && !SDL_PLATFORM_XBOXONE && !SDL_PLATFORM_XBOXSERIES +#endif // !SDL_PLATFORM_XBOXONE && !SDL_PLATFORM_XBOXSERIES diff --git a/src/core/windows/SDL_hid.h b/src/core/windows/SDL_hid.h index afa00717b..50c5d38c0 100644 --- a/src/core/windows/SDL_hid.h +++ b/src/core/windows/SDL_hid.h @@ -25,8 +25,6 @@ #include "SDL_windows.h" -#ifndef SDL_PLATFORM_WINRT - typedef LONG NTSTATUS; typedef USHORT USAGE; typedef struct _HIDP_PREPARSED_DATA *PHIDP_PREPARSED_DATA; @@ -208,9 +206,6 @@ extern HidP_GetValueCaps_t SDL_HidP_GetValueCaps; extern HidP_MaxDataListLength_t SDL_HidP_MaxDataListLength; extern HidP_GetData_t SDL_HidP_GetData; -#endif // !SDL_PLATFORM_WINRT - - void WIN_InitDeviceNotification(void); Uint64 WIN_GetLastDeviceNotification(void); void WIN_QuitDeviceNotification(void); diff --git a/src/core/windows/SDL_windows.c b/src/core/windows/SDL_windows.c index 393cefea8..cc3c52959 100644 --- a/src/core/windows/SDL_windows.c +++ b/src/core/windows/SDL_windows.c @@ -20,7 +20,7 @@ */ #include "SDL_internal.h" -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) #include "SDL_windows.h" @@ -90,14 +90,7 @@ WIN_CoInitialize(void) If you need multi-threaded mode, call CoInitializeEx() before SDL_Init() */ -#ifdef SDL_PLATFORM_WINRT - /* DLudwig: On WinRT, it is assumed that COM was initialized in main(). - CoInitializeEx is available (not CoInitialize though), however - on WinRT, main() is typically declared with the [MTAThread] - attribute, which, AFAIK, should initialize COM. - */ - return S_OK; -#elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) +#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) // On Xbox, there's no need to call CoInitializeEx (and it's not implemented) return S_OK; #else @@ -118,12 +111,9 @@ WIN_CoInitialize(void) void WIN_CoUninitialize(void) { -#ifndef SDL_PLATFORM_WINRT CoUninitialize(); -#endif } -#ifndef SDL_PLATFORM_WINRT FARPROC WIN_LoadComBaseFunction(const char *name) { static bool s_bLoaded; @@ -139,14 +129,10 @@ FARPROC WIN_LoadComBaseFunction(const char *name) return NULL; } } -#endif HRESULT WIN_RoInitialize(void) { -#ifdef SDL_PLATFORM_WINRT - return S_OK; -#else typedef HRESULT(WINAPI * RoInitialize_t)(RO_INIT_TYPE initType); RoInitialize_t RoInitializeFunc = (RoInitialize_t)WIN_LoadComBaseFunction("RoInitialize"); if (RoInitializeFunc) { @@ -166,21 +152,18 @@ WIN_RoInitialize(void) } else { return E_NOINTERFACE; } -#endif } void WIN_RoUninitialize(void) { -#ifndef SDL_PLATFORM_WINRT typedef void(WINAPI * RoUninitialize_t)(void); RoUninitialize_t RoUninitializeFunc = (RoUninitialize_t)WIN_LoadComBaseFunction("RoUninitialize"); if (RoUninitializeFunc) { RoUninitializeFunc(); } -#endif } -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) static BOOL IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WORD wServicePackMajor) { OSVERSIONINFOEXW osvi; @@ -202,7 +185,7 @@ static BOOL IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WO #endif // apply some static variables so we only call into the Win32 API once per process for each check. -#if defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) +#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) #define CHECKWINVER(notdesktop_platform_result, test) return (notdesktop_platform_result); #else #define CHECKWINVER(notdesktop_platform_result, test) \ @@ -265,8 +248,8 @@ WASAPI doesn't need this. This is just for DirectSound/WinMM. */ char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) { -#if defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) - return WIN_StringToUTF8W(name); // No registry access on WinRT/UWP and Xbox, go with what we've got. +#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) + return WIN_StringToUTF8W(name); // No registry access on Xbox, go with what we've got. #else static const GUID nullguid = { 0 }; const unsigned char *ptr; @@ -318,7 +301,7 @@ char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) result = WIN_StringToUTF8(strw); SDL_free(strw); return result ? result : WIN_StringToUTF8(name); -#endif // if SDL_PLATFORM_WINRT / else +#endif } BOOL WIN_IsEqualGUID(const GUID *a, const GUID *b) @@ -349,7 +332,7 @@ void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect) BOOL WIN_IsRectEmpty(const RECT *rect) { - // Calculating this manually because UWP and Xbox do not support Win32 IsRectEmpty. + // Calculating this manually because Xbox does not support Win32 IsRectEmpty. return (rect->right <= rect->left) || (rect->bottom <= rect->top); } @@ -389,4 +372,4 @@ int WIN_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWCH lpWideCharStr, return WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar); } -#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) +#endif // defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) diff --git a/src/core/windows/SDL_windows.h b/src/core/windows/SDL_windows.h index f83e21406..bc0aaf3e4 100644 --- a/src/core/windows/SDL_windows.h +++ b/src/core/windows/SDL_windows.h @@ -122,10 +122,8 @@ extern bool WIN_SetErrorFromHRESULT(const char *prefix, HRESULT hr); // Sets an error message based on GetLastError(). Always return -1. extern bool WIN_SetError(const char *prefix); -#ifndef SDL_PLATFORM_WINRT // Load a function from combase.dll FARPROC WIN_LoadComBaseFunction(const char *name); -#endif // Wrap up the oddities of CoInitialize() into a common function. extern HRESULT WIN_CoInitialize(void); diff --git a/src/core/windows/SDL_xinput.c b/src/core/windows/SDL_xinput.c index 32d4722ef..76b5bd2c1 100644 --- a/src/core/windows/SDL_xinput.c +++ b/src/core/windows/SDL_xinput.c @@ -37,21 +37,17 @@ DWORD SDL_XInputVersion = 0; static HMODULE s_pXInputDLL = NULL; static int s_XInputDLLRefCount = 0; -#if defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) +#if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) bool WIN_LoadXInputDLL(void) { /* Getting handles to system dlls (via LoadLibrary and its variants) is not - * supported on WinRT, thus, pointers to XInput's functions can't be + * supported on Xbox, thus, pointers to XInput's functions can't be * retrieved via GetProcAddress. * - * When on WinRT, assume that XInput is already loaded, and directly map + * When on Xbox, assume that XInput is already loaded, and directly map * its XInput.h-declared functions to the SDL_XInput* set of function * pointers. - * - * Side-note: XInputGetStateEx is not available for use in WinRT. - * This seems to mean that support for the guide button is not available - * in WinRT, unfortunately. */ SDL_XInputGetState = (XInputGetState_t)XInputGetState; SDL_XInputSetState = (XInputSetState_t)XInputSetState; @@ -68,7 +64,7 @@ void WIN_UnloadXInputDLL(void) { } -#else // !(defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) +#else // !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES)) bool WIN_LoadXInputDLL(void) { @@ -136,7 +132,7 @@ void WIN_UnloadXInputDLL(void) } } -#endif // SDL_PLATFORM_WINRT +#endif // Ends C function definitions when using C++ #ifdef __cplusplus diff --git a/src/core/winrt/SDL_winrtapp_common.cpp b/src/core/winrt/SDL_winrtapp_common.cpp deleted file mode 100644 index be3558dea..000000000 --- a/src/core/winrt/SDL_winrtapp_common.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include - -int (*WINRT_SDLAppEntryPoint)(int, char **) = NULL; - -extern "C" -SDL_WinRT_DeviceFamily SDL_GetWinRTDeviceFamily() -{ -#if NTDDI_VERSION >= NTDDI_WIN10 // !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. - Platform::String ^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily; - - if (deviceFamily->Equals("Windows.Desktop")) { - return SDL_WINRT_DEVICEFAMILY_DESKTOP; - } else if (deviceFamily->Equals("Windows.Mobile")) { - return SDL_WINRT_DEVICEFAMILY_MOBILE; - } else if (deviceFamily->Equals("Windows.Xbox")) { - return SDL_WINRT_DEVICEFAMILY_XBOX; - } -#endif - - return SDL_WINRT_DEVICEFAMILY_UNKNOWN; -} diff --git a/src/core/winrt/SDL_winrtapp_common.h b/src/core/winrt/SDL_winrtapp_common.h deleted file mode 100644 index 83cfd7762..000000000 --- a/src/core/winrt/SDL_winrtapp_common.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifndef SDL_winrtapp_common_h_ -#define SDL_winrtapp_common_h_ - -/* A pointer to the app's C-style main() function (which is a different - function than the WinRT app's actual entry point). - */ -extern int (*WINRT_SDLAppEntryPoint)(int, char **); - -#endif // SDL_winrtapp_common_h_ diff --git a/src/core/winrt/SDL_winrtapp_direct3d.cpp b/src/core/winrt/SDL_winrtapp_direct3d.cpp deleted file mode 100644 index 7886a5b58..000000000 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ /dev/null @@ -1,758 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -// Windows includes -#include "ppltasks.h" -using namespace concurrency; -using namespace Windows::ApplicationModel; -using namespace Windows::ApplicationModel::Core; -using namespace Windows::ApplicationModel::Activation; -using namespace Windows::Devices::Input; -using namespace Windows::Graphics::Display; -using namespace Windows::Foundation; -using namespace Windows::System; -using namespace Windows::UI::Core; -using namespace Windows::UI::Input; - -#if SDL_WINAPI_FAMILY_PHONE -using namespace Windows::Phone::UI::Input; -#endif - -// SDL includes -extern "C" { -#include "../../video/SDL_sysvideo.h" -#include "../../events/SDL_events_c.h" -#include "../../events/SDL_keyboard_c.h" -#include "../../events/SDL_mouse_c.h" -#include "../../events/SDL_windowevents_c.h" -#include "../../render/SDL_sysrender.h" -#include "../windows/SDL_windows.h" -} - -#include "../../video/winrt/SDL_winrtevents_c.h" -#include "../../video/winrt/SDL_winrtvideo_cpp.h" -#include "SDL_winrtapp_common.h" -#include "SDL_winrtapp_direct3d.h" - -#ifdef SDL_VIDEO_RENDER_D3D11 -/* Calling IDXGIDevice3::Trim on the active Direct3D 11.x device is necessary - * when Windows 8.1 apps are about to get suspended. - */ -extern "C" void D3D11_Trim(SDL_Renderer *); -#endif - -// Compile-time debugging options: -// To enable, uncomment; to disable, comment them out. -// #define LOG_POINTER_EVENTS 1 -// #define LOG_WINDOW_EVENTS 1 -// #define LOG_ORIENTATION_EVENTS 1 - -// HACK, DLudwig: record a reference to the global, WinRT 'app'/view. -// SDL/WinRT will use this throughout its code. -// -// TODO, WinRT: consider replacing SDL_WinRTGlobalApp with something -// non-global, such as something created inside -// SDL_InitSubSystem(SDL_INIT_VIDEO), or something inside -// SDL_CreateWindow(). -SDL_WinRTApp ^ SDL_WinRTGlobalApp = nullptr; - -ref class SDLApplicationSource sealed : Windows::ApplicationModel::Core::IFrameworkViewSource -{ - public: - virtual Windows::ApplicationModel::Core::IFrameworkView ^ CreateView(); -}; - -IFrameworkView ^ SDLApplicationSource::CreateView() -{ - // TODO, WinRT: see if this function (CreateView) can ever get called - // more than once. For now, just prevent it from ever assigning - // SDL_WinRTGlobalApp more than once. - SDL_assert(!SDL_WinRTGlobalApp); - SDL_WinRTApp ^ app = ref new SDL_WinRTApp(); - if (!SDL_WinRTGlobalApp) { - SDL_WinRTGlobalApp = app; - } - return app; -} - -bool SDL_WinRTInitNonXAMLApp(int (*mainFunction)(int, char **)) -{ - WINRT_SDLAppEntryPoint = mainFunction; - auto direct3DApplicationSource = ref new SDLApplicationSource(); - CoreApplication::Run(direct3DApplicationSource); - return true; -} - -static void WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identifying thing into WINRT_ProcessWindowSizeChange() -{ - CoreWindow ^ coreWindow = CoreWindow::GetForCurrentThread(); - if (coreWindow) { - if (WINRT_GlobalSDLWindow) { - SDL_Window *window = WINRT_GlobalSDLWindow; - SDL_WindowData *data = window->internal; - - int x = (int)SDL_lroundf(data->coreWindow->Bounds.Left); - int y = (int)SDL_lroundf(data->coreWindow->Bounds.Top); - int w = (int)SDL_floorf(data->coreWindow->Bounds.Width); - int h = (int)SDL_floorf(data->coreWindow->Bounds.Height); - -#if SDL_WINAPI_FAMILY_PHONE && NTDDI_VERSION == NTDDI_WIN8 - /* WinPhone 8.0 always keeps its native window size in portrait, - regardless of orientation. This changes in WinPhone 8.1, - in which the native window's size changes along with - orientation. - - Attempt to emulate WinPhone 8.1's behavior on WinPhone 8.0, with - regards to window size. This fixes a rendering bug that occurs - when a WinPhone 8.0 app is rotated to either 90 or 270 degrees. - */ - const DisplayOrientations currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation); - switch (currentOrientation) { - case DisplayOrientations::Landscape: - case DisplayOrientations::LandscapeFlipped: - { - int tmp = w; - w = h; - h = tmp; - } break; - } -#endif - - const SDL_WindowFlags latestFlags = WINRT_DetectWindowFlags(window); - if (latestFlags & SDL_WINDOW_MAXIMIZED) { - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MAXIMIZED, 0, 0); - } else { - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESTORED, 0, 0); - } - - WINRT_UpdateWindowFlags(window, SDL_WINDOW_FULLSCREEN); - - /* The window can move during a resize event, such as when maximizing - or resizing from a corner */ - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_MOVED, x, y); - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, w, h); - } - } -} - -SDL_WinRTApp::SDL_WinRTApp() : m_windowClosed(false), - m_windowVisible(true) -{ -} - -void SDL_WinRTApp::Initialize(CoreApplicationView ^ applicationView) -{ - applicationView->Activated += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnAppActivated); - - CoreApplication::Suspending += - ref new EventHandler(this, &SDL_WinRTApp::OnSuspending); - - CoreApplication::Resuming += - ref new EventHandler(this, &SDL_WinRTApp::OnResuming); - - CoreApplication::Exiting += - ref new EventHandler(this, &SDL_WinRTApp::OnExiting); - -#if NTDDI_VERSION >= NTDDI_WIN10 - /* HACK ALERT! Xbox One doesn't seem to detect gamepads unless something - gets registered to receive Win10's Windows.Gaming.Input.Gamepad.GamepadAdded - events. We'll register an event handler for these events here, to make - sure that gamepad detection works later on, if requested. - */ - Windows::Gaming::Input::Gamepad::GamepadAdded += - ref new Windows::Foundation::EventHandler( - this, &SDL_WinRTApp::OnGamepadAdded); -#endif -} - -#if NTDDI_VERSION > NTDDI_WIN8 -void SDL_WinRTApp::OnOrientationChanged(DisplayInformation ^ sender, Object ^ args) -#else -void SDL_WinRTApp::OnOrientationChanged(Object ^ sender) -#endif -{ -#if LOG_ORIENTATION_EVENTS == 1 - { - CoreWindow ^ window = CoreWindow::GetForCurrentThread(); - if (window) { - SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, CoreWindow Bounds={%f,%f,%f,%f}\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - window->Bounds.X, - window->Bounds.Y, - window->Bounds.Width, - window->Bounds.Height); - } else { - SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences)); - } - } -#endif - - WINRT_ProcessWindowSizeChange(); - -#if SDL_WINAPI_FAMILY_PHONE - // HACK: Make sure that orientation changes - // lead to the Direct3D renderer's viewport getting updated: - // - // For some reason, this doesn't seem to need to be done on Windows 8.x, - // even when going from Landscape to LandscapeFlipped. It only seems to - // be needed on Windows Phone, at least when I tested on my devices. - // I'm not currently sure why this is, but it seems to work fine. -- David L. - // - // TODO, WinRT: do more extensive research into why orientation changes on Win 8.x don't need D3D changes, or if they might, in some cases - SDL_Window *window = WINRT_GlobalSDLWindow; - if (window) { - SDL_WindowData *data = window->internal; - int w = (int)SDL_floorf(data->coreWindow->Bounds.Width); - int h = (int)SDL_floorf(data->coreWindow->Bounds.Height); - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_RESIZED, w, h); - } -#endif -} - -void SDL_WinRTApp::SetWindow(CoreWindow ^ window) -{ -#if LOG_WINDOW_EVENTS == 1 - SDL_Log("%s, current orientation=%d, native orientation=%d, auto rot. pref=%d, window bounds={%f, %f, %f,%f}\n", - __FUNCTION__, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - window->Bounds.X, - window->Bounds.Y, - window->Bounds.Width, - window->Bounds.Height); -#endif - - window->SizeChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowSizeChanged); - - window->VisibilityChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnVisibilityChanged); - - window->Activated += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowActivated); - - window->Closed += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnWindowClosed); - -#if !SDL_WINAPI_FAMILY_PHONE - window->PointerCursor = ref new CoreCursor(CoreCursorType::Arrow, 0); -#endif - - window->PointerPressed += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerPressed); - - window->PointerMoved += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerMoved); - - window->PointerReleased += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerReleased); - - window->PointerEntered += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerEntered); - - window->PointerExited += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerExited); - - window->PointerWheelChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnPointerWheelChanged); - -#if !SDL_WINAPI_FAMILY_PHONE - // Retrieves relative-only mouse movements: - Windows::Devices::Input::MouseDevice::GetForCurrentView()->MouseMoved += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnMouseMoved); -#endif - - window->Dispatcher->AcceleratorKeyActivated += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnAcceleratorKeyActivated); - - window->CharacterReceived += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnCharacterReceived); - -#if NTDDI_VERSION >= NTDDI_WIN10 - Windows::UI::Core::SystemNavigationManager::GetForCurrentView()->BackRequested += - ref new EventHandler(this, &SDL_WinRTApp::OnBackButtonPressed); -#elif SDL_WINAPI_FAMILY_PHONE - HardwareButtons::BackPressed += - ref new EventHandler(this, &SDL_WinRTApp::OnBackButtonPressed); -#endif - -#if NTDDI_VERSION > NTDDI_WIN8 - DisplayInformation::GetForCurrentView()->OrientationChanged += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnOrientationChanged); -#else - DisplayProperties::OrientationChanged += - ref new DisplayPropertiesEventHandler(this, &SDL_WinRTApp::OnOrientationChanged); -#endif - -#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) - // Make sure we know when a user has opened the app's settings pane. - // This is needed in order to display a privacy policy, which needs - // to be done for network-enabled apps, as per Windows Store requirements. - using namespace Windows::UI::ApplicationSettings; - SettingsPane::GetForCurrentView()->CommandsRequested += - ref new TypedEventHandler(this, &SDL_WinRTApp::OnSettingsPaneCommandsRequested); -#endif -} - -void SDL_WinRTApp::Load(Platform::String ^ entryPoint) -{ -} - -void SDL_WinRTApp::Run() -{ - SDL_SetMainReady(); - if (WINRT_SDLAppEntryPoint) { - // TODO, WinRT: pass the C-style main() a reasonably realistic - // representation of command line arguments. - int argc = 1; - char **argv = (char **)SDL_malloc(2 * sizeof(*argv)); - if (!argv) { - return; - } - argv[0] = SDL_strdup("WinRTApp"); - argv[1] = NULL; - WINRT_SDLAppEntryPoint(argc, argv); - SDL_free(argv[0]); - SDL_free(argv); - } -} - -static bool IsSDLWindowEventPending(SDL_EventType windowEventID) -{ - SDL_Event events[128]; - const int count = SDL_PeepEvents(events, sizeof(events) / sizeof(SDL_Event), SDL_PEEKEVENT, windowEventID, windowEventID); - return (count > 0); -} - -bool SDL_WinRTApp::ShouldWaitForAppResumeEvents() -{ - // Don't wait if the app is visible: - if (m_windowVisible) { - return false; - } - - /* Don't wait until the window-hide events finish processing. - * Do note that if an app-suspend event is sent (as indicated - * by SDL_EVENT_WILL_ENTER_BACKGROUND and SDL_EVENT_DID_ENTER_BACKGROUND - * events), then this code may be a moot point, as WinRT's - * own event pump (aka ProcessEvents()) will pause regardless - * of what we do here. This happens on Windows Phone 8, to note. - * Windows 8.x apps, on the other hand, may get a chance to run - * these. - */ - if (IsSDLWindowEventPending(SDL_EVENT_WINDOW_HIDDEN)) { - return false; - } else if (IsSDLWindowEventPending(SDL_EVENT_WINDOW_FOCUS_LOST)) { - return false; - } else if (IsSDLWindowEventPending(SDL_EVENT_WINDOW_MINIMIZED)) { - return false; - } - - return true; -} - -void SDL_WinRTApp::PumpEvents() -{ - if (!m_windowClosed) { - if (!ShouldWaitForAppResumeEvents()) { - /* This is the normal way in which events should be pumped. - * 'ProcessAllIfPresent' will make ProcessEvents() process anywhere - * from zero to N events, and will then return. - */ - CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); - } else { - /* This style of event-pumping, with 'ProcessOneAndAllPending', - * will cause anywhere from one to N events to be processed. If - * at least one event is processed, the call will return. If - * no events are pending, then the call will wait until one is - * available, and will not return (to the caller) until this - * happens! This should only occur when the app is hidden. - */ - CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); - } - } -} - -void SDL_WinRTApp::Uninitialize() -{ -} - -#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) -void SDL_WinRTApp::OnSettingsPaneCommandsRequested( - Windows::UI::ApplicationSettings::SettingsPane ^ p, - Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^ args) -{ - using namespace Platform; - using namespace Windows::UI::ApplicationSettings; - using namespace Windows::UI::Popups; - - String ^ privacyPolicyURL = nullptr; // a URL to an app's Privacy Policy - String ^ privacyPolicyLabel = nullptr; // label/link text - const char *tmpHintValue = NULL; // SDL_GetHint-retrieved value, used immediately - wchar_t *tmpStr = NULL; // used for UTF8 to UCS2 conversion - - // Setup a 'Privacy Policy' link, if one is available (via SDL_GetHint): - tmpHintValue = SDL_GetHint(SDL_HINT_WINRT_PRIVACY_POLICY_URL); - if (tmpHintValue && tmpHintValue[0] != '\0') { - // Convert the privacy policy's URL to UCS2: - tmpStr = WIN_UTF8ToString(tmpHintValue); - privacyPolicyURL = ref new String(tmpStr); - SDL_free(tmpStr); - - // Optionally retrieve custom label-text for the link. If this isn't - // available, a default value will be used instead. - tmpHintValue = SDL_GetHint(SDL_HINT_WINRT_PRIVACY_POLICY_LABEL); - if (tmpHintValue && tmpHintValue[0] != '\0') { - tmpStr = WIN_UTF8ToString(tmpHintValue); - privacyPolicyLabel = ref new String(tmpStr); - SDL_free(tmpStr); - } else { - privacyPolicyLabel = ref new String(L"Privacy Policy"); - } - - // Register the link, along with a handler to be called if and when it is - // clicked: - auto cmd = ref new SettingsCommand(L"privacyPolicy", privacyPolicyLabel, - ref new UICommandInvokedHandler([=](IUICommand ^) { - Windows::System::Launcher::LaunchUriAsync(ref new Uri(privacyPolicyURL)); - })); - args->Request->ApplicationCommands->Append(cmd); - } -} -#endif // if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) - -void SDL_WinRTApp::OnWindowSizeChanged(CoreWindow ^ sender, WindowSizeChangedEventArgs ^ args) -{ -#if LOG_WINDOW_EVENTS == 1 - SDL_Log("%s, size={%f,%f}, bounds={%f,%f,%f,%f}, current orientation=%d, native orientation=%d, auto rot. pref=%d, WINRT_GlobalSDLWindow?=%s\n", - __FUNCTION__, - args->Size.Width, args->Size.Height, - sender->Bounds.X, sender->Bounds.Y, sender->Bounds.Width, sender->Bounds.Height, - WINRT_DISPLAY_PROPERTY(CurrentOrientation), - WINRT_DISPLAY_PROPERTY(NativeOrientation), - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences), - (WINRT_GlobalSDLWindow ? "yes" : "no")); -#endif - - WINRT_ProcessWindowSizeChange(); -} - -void SDL_WinRTApp::OnVisibilityChanged(CoreWindow ^ sender, VisibilityChangedEventArgs ^ args) -{ -#if LOG_WINDOW_EVENTS == 1 - SDL_Log("%s, visible?=%s, bounds={%f,%f,%f,%f}, WINRT_GlobalSDLWindow?=%s\n", - __FUNCTION__, - (args->Visible ? "yes" : "no"), - sender->Bounds.X, sender->Bounds.Y, - sender->Bounds.Width, sender->Bounds.Height, - (WINRT_GlobalSDLWindow ? "yes" : "no")); -#endif - - m_windowVisible = args->Visible; - if (WINRT_GlobalSDLWindow) { - bool wasSDLWindowSurfaceValid = WINRT_GlobalSDLWindow->surface_valid; - SDL_WindowFlags latestWindowFlags = WINRT_DetectWindowFlags(WINRT_GlobalSDLWindow); - if (args->Visible) { - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_SHOWN, 0, 0); - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_FOCUS_GAINED, 0, 0); - if (latestWindowFlags & SDL_WINDOW_MAXIMIZED) { - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_MAXIMIZED, 0, 0); - } else { - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_RESTORED, 0, 0); - } - } else { - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_HIDDEN, 0, 0); - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_FOCUS_LOST, 0, 0); - SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_MINIMIZED, 0, 0); - } - - // HACK: Prevent SDL's window-hide handling code, which currently - // triggers a fake window resize (possibly erroneously), from - // marking the SDL window's surface as invalid. - // - // A better solution to this probably involves figuring out if the - // fake window resize can be prevented. - WINRT_GlobalSDLWindow->surface_valid = wasSDLWindowSurfaceValid; - } -} - -void SDL_WinRTApp::OnWindowActivated(CoreWindow ^ sender, WindowActivatedEventArgs ^ args) -{ -#if LOG_WINDOW_EVENTS == 1 - SDL_Log("%s, WINRT_GlobalSDLWindow?=%s\n\n", - __FUNCTION__, - (WINRT_GlobalSDLWindow ? "yes" : "no")); -#endif - - /* There's no property in Win 8.x to tell whether a window is active or - not. [De]activation events are, however, sent to the app. We'll just - record those, in case the CoreWindow gets wrapped by an SDL_Window at - some future time. - */ - sender->CustomProperties->Insert("SDLHelperWindowActivationState", args->WindowActivationState); - - SDL_Window *window = WINRT_GlobalSDLWindow; - if (window) { - if (args->WindowActivationState != CoreWindowActivationState::Deactivated) { - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_SHOWN, 0, 0); - if (SDL_GetKeyboardFocus() != window) { - SDL_SetKeyboardFocus(window); - } - - /* Send a mouse-motion event as appropriate. - This doesn't work when called from OnPointerEntered, at least - not in WinRT CoreWindow apps (as OnPointerEntered doesn't - appear to be called after window-reactivation, at least not - in Windows 10, Build 10586.3 (November 2015 update, non-beta). - - Don't do it on WinPhone 8.0 though, as CoreWindow's 'PointerPosition' - property isn't available. - */ -#if !SDL_WINAPI_FAMILY_PHONE || NTDDI_VERSION >= NTDDI_WINBLUE - Point cursorPos = WINRT_TransformCursorPosition(window, sender->PointerPosition, TransformToSDLWindowSize); - SDL_SendMouseMotion(0, window, SDL_GLOBAL_MOUSE_ID, false, cursorPos.X, cursorPos.Y); -#endif - - // TODO, WinRT: see if the Win32 bugfix from https://hg.libsdl.org/SDL/rev/d278747da408 needs to be applied (on window activation) - // WIN_CheckAsyncMouseRelease(data); - - // TODO, WinRT: implement clipboard support, if possible - ///* - // * FIXME: Update keyboard state - // */ - // WIN_CheckClipboardUpdate(data->videodata); - - // HACK: Resetting the mouse-cursor here seems to fix - // https://bugzilla.libsdl.org/show_bug.cgi?id=3217, whereby a - // WinRT app's mouse cursor may switch to Windows' 'wait' cursor, - // after a user alt-tabs back into a full-screened SDL app. - // This bug does not appear to reproduce 100% of the time. - // It may be a bug in Windows itself (v.10.0.586.36, as tested, - // and the most-recent as of this writing). - SDL_SetCursor(NULL); - } else { - if (SDL_GetKeyboardFocus() == window) { - SDL_SetKeyboardFocus(NULL); - } - } - } -} - -void SDL_WinRTApp::OnWindowClosed(CoreWindow ^ sender, CoreWindowEventArgs ^ args) -{ -#if LOG_WINDOW_EVENTS == 1 - SDL_Log("%s\n", __FUNCTION__); -#endif - m_windowClosed = true; -} - -void SDL_WinRTApp::OnAppActivated(CoreApplicationView ^ applicationView, IActivatedEventArgs ^ args) -{ - CoreWindow::GetForCurrentThread()->Activate(); -} - -void SDL_WinRTApp::OnSuspending(Platform::Object ^ sender, SuspendingEventArgs ^ args) -{ - // Save app state asynchronously after requesting a deferral. Holding a deferral - // indicates that the application is busy performing suspending operations. Be - // aware that a deferral may not be held indefinitely. After about five seconds, - // the app will be forced to exit. - - // ... but first, let the app know it's about to go to the background. - // The separation of events may be important, given that the deferral - // runs in a separate thread. This'll make SDL_EVENT_WILL_ENTER_BACKGROUND - // the only event among the two that runs in the main thread. Given - // that a few WinRT operations can only be done from the main thread - // (things that access the WinRT CoreWindow are one example of this), - // this could be important. - SDL_SendAppEvent(SDL_EVENT_WILL_ENTER_BACKGROUND); - - SuspendingDeferral ^ deferral = args->SuspendingOperation->GetDeferral(); - create_task([this, deferral]() { - // Send an app did-enter-background event immediately to observers. - // CoreDispatcher::ProcessEvents, which is the backbone on which - // SDL_WinRTApp::PumpEvents is built, will not return to its caller - // once it sends out a suspend event. Any events posted to SDL's - // event queue won't get received until the WinRT app is resumed. - // SDL_AddEventWatch() may be used to receive app-suspend events on - // WinRT. - SDL_SendAppEvent(SDL_EVENT_DID_ENTER_BACKGROUND); - - // Let the Direct3D 11 renderer prepare for the app to be backgrounded. - // This is necessary for Windows 8.1, possibly elsewhere in the future. - // More details at: http://msdn.microsoft.com/en-us/library/windows/apps/Hh994929.aspx -#ifdef SDL_VIDEO_RENDER_D3D11 - if (WINRT_GlobalSDLWindow) { - SDL_Renderer *renderer = SDL_GetRenderer(WINRT_GlobalSDLWindow); - if (renderer && (SDL_strcmp(renderer->name, "direct3d11") == 0)) { - D3D11_Trim(renderer); - } - } -#endif - - deferral->Complete(); - }); -} - -void SDL_WinRTApp::OnResuming(Platform::Object ^ sender, Platform::Object ^ args) -{ - // Restore any data or state that was unloaded on suspend. By default, data - // and state are persisted when resuming from suspend. Note that these events - // do not occur if the app was previously terminated. - SDL_SendAppEvent(SDL_EVENT_WILL_ENTER_FOREGROUND); - SDL_SendAppEvent(SDL_EVENT_DID_ENTER_FOREGROUND); -} - -void SDL_WinRTApp::OnExiting(Platform::Object ^ sender, Platform::Object ^ args) -{ - SDL_SendAppEvent(SDL_EVENT_TERMINATING); -} - -static void WINRT_LogPointerEvent(const char *header, Windows::UI::Core::PointerEventArgs ^ args, Windows::Foundation::Point transformedPoint) -{ - Uint8 button, pressed; - Windows::UI::Input::PointerPoint ^ pt = args->CurrentPoint; - WINRT_GetSDLButtonForPointerPoint(pt, &button, &pressed); - SDL_Log("%s: Position={%f,%f}, Transformed Pos={%f, %f}, MouseWheelDelta=%d, FrameId=%d, PointerId=%d, SDL button=%d pressed=%d\n", - header, - pt->Position.X, pt->Position.Y, - transformedPoint.X, transformedPoint.Y, - pt->Properties->MouseWheelDelta, - pt->FrameId, - pt->PointerId, - button, - pressed); -} - -void SDL_WinRTApp::OnPointerPressed(CoreWindow ^ sender, PointerEventArgs ^ args) -{ -#if LOG_POINTER_EVENTS - WINRT_LogPointerEvent("pointer pressed", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); -#endif - - WINRT_ProcessPointerPressedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); -} - -void SDL_WinRTApp::OnPointerMoved(CoreWindow ^ sender, PointerEventArgs ^ args) -{ -#if LOG_POINTER_EVENTS - WINRT_LogPointerEvent("pointer moved", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); -#endif - - WINRT_ProcessPointerMovedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); -} - -void SDL_WinRTApp::OnPointerReleased(CoreWindow ^ sender, PointerEventArgs ^ args) -{ -#if LOG_POINTER_EVENTS - WINRT_LogPointerEvent("pointer released", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); -#endif - - WINRT_ProcessPointerReleasedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); -} - -void SDL_WinRTApp::OnPointerEntered(CoreWindow ^ sender, PointerEventArgs ^ args) -{ -#if LOG_POINTER_EVENTS - WINRT_LogPointerEvent("pointer entered", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); -#endif - - WINRT_ProcessPointerEnteredEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); -} - -void SDL_WinRTApp::OnPointerExited(CoreWindow ^ sender, PointerEventArgs ^ args) -{ -#if LOG_POINTER_EVENTS - WINRT_LogPointerEvent("pointer exited", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); -#endif - - WINRT_ProcessPointerExitedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); -} - -void SDL_WinRTApp::OnPointerWheelChanged(CoreWindow ^ sender, PointerEventArgs ^ args) -{ -#if LOG_POINTER_EVENTS - WINRT_LogPointerEvent("pointer wheel changed", args, WINRT_TransformCursorPosition(WINRT_GlobalSDLWindow, args->CurrentPoint->Position, TransformToSDLWindowSize)); -#endif - - WINRT_ProcessPointerWheelChangedEvent(WINRT_GlobalSDLWindow, args->CurrentPoint); -} - -void SDL_WinRTApp::OnMouseMoved(MouseDevice ^ mouseDevice, MouseEventArgs ^ args) -{ - WINRT_ProcessMouseMovedEvent(WINRT_GlobalSDLWindow, args); -} - -void SDL_WinRTApp::OnAcceleratorKeyActivated(Windows::UI::Core::CoreDispatcher ^ sender, Windows::UI::Core::AcceleratorKeyEventArgs ^ args) -{ - WINRT_ProcessAcceleratorKeyActivated(args); -} - -void SDL_WinRTApp::OnCharacterReceived(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::CharacterReceivedEventArgs ^ args) -{ - WINRT_ProcessCharacterReceivedEvent(WINRT_GlobalSDLWindow, args); -} - -template -static void WINRT_OnBackButtonPressed(BackButtonEventArgs ^ args) -{ - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_AC_BACK, SDL_PRESSED); - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_AC_BACK, SDL_RELEASED); - - if (SDL_GetHintBoolean(SDL_HINT_WINRT_HANDLE_BACK_BUTTON, false)) { - args->Handled = true; - } -} - -#if NTDDI_VERSION >= NTDDI_WIN10 -void SDL_WinRTApp::OnBackButtonPressed(Platform::Object ^ sender, Windows::UI::Core::BackRequestedEventArgs ^ args) - -{ - WINRT_OnBackButtonPressed(args); -} -#elif SDL_WINAPI_FAMILY_PHONE -void SDL_WinRTApp::OnBackButtonPressed(Platform::Object ^ sender, Windows::Phone::UI::Input::BackPressedEventArgs ^ args) - -{ - WINRT_OnBackButtonPressed(args); -} -#endif - -#if NTDDI_VERSION >= NTDDI_WIN10 -void SDL_WinRTApp::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ gamepad) -{ - /* HACK ALERT: Nothing needs to be done here, as this method currently - only exists to allow something to be registered with Win10's - GamepadAdded event, an operation that seems to be necessary to get - Xinput-based detection to work on Xbox One. - */ -} -#endif diff --git a/src/core/winrt/SDL_winrtapp_direct3d.h b/src/core/winrt/SDL_winrtapp_direct3d.h deleted file mode 100644 index 07e6f162d..000000000 --- a/src/core/winrt/SDL_winrtapp_direct3d.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include - -extern bool SDL_WinRTInitNonXAMLApp(int (*mainFunction)(int, char **)); - -ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFrameworkView -{ - public: - SDL_WinRTApp(); - - // IFrameworkView Methods. - virtual void Initialize(Windows::ApplicationModel::Core::CoreApplicationView ^ applicationView); - virtual void SetWindow(Windows::UI::Core::CoreWindow ^ window); - virtual void Load(Platform::String ^ entryPoint); - virtual void Run(); - virtual void Uninitialize(); - - internal : - // SDL-specific methods - void - PumpEvents(); - - protected: - bool ShouldWaitForAppResumeEvents(); - - // Event Handlers. - -#if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) // for Windows 8/8.1/RT apps... (and not Phone apps) - void OnSettingsPaneCommandsRequested( - Windows::UI::ApplicationSettings::SettingsPane ^ p, - Windows::UI::ApplicationSettings::SettingsPaneCommandsRequestedEventArgs ^ args); -#endif // if (WINAPI_FAMILY == WINAPI_FAMILY_APP) && (NTDDI_VERSION < NTDDI_WIN10) - -#if NTDDI_VERSION > NTDDI_WIN8 - void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation ^ sender, Platform::Object ^ args); -#else - void OnOrientationChanged(Platform::Object ^ sender); -#endif - void OnWindowSizeChanged(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::WindowSizeChangedEventArgs ^ args); - void OnLogicalDpiChanged(Platform::Object ^ sender); - void OnAppActivated(Windows::ApplicationModel::Core::CoreApplicationView ^ applicationView, Windows::ApplicationModel::Activation::IActivatedEventArgs ^ args); - void OnSuspending(Platform::Object ^ sender, Windows::ApplicationModel::SuspendingEventArgs ^ args); - void OnResuming(Platform::Object ^ sender, Platform::Object ^ args); - void OnExiting(Platform::Object ^ sender, Platform::Object ^ args); - void OnWindowActivated(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::WindowActivatedEventArgs ^ args); - void OnWindowClosed(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::CoreWindowEventArgs ^ args); - void OnVisibilityChanged(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::VisibilityChangedEventArgs ^ args); - void OnPointerPressed(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); - void OnPointerReleased(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); - void OnPointerWheelChanged(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); - void OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); - void OnPointerEntered(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); - void OnPointerExited(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::PointerEventArgs ^ args); - void OnMouseMoved(Windows::Devices::Input::MouseDevice ^ mouseDevice, Windows::Devices::Input::MouseEventArgs ^ args); - void OnAcceleratorKeyActivated(Windows::UI::Core::CoreDispatcher ^ sender, Windows::UI::Core::AcceleratorKeyEventArgs ^ args); - void OnCharacterReceived(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Core::CharacterReceivedEventArgs ^ args); - -#if NTDDI_VERSION >= NTDDI_WIN10 - void OnBackButtonPressed(Platform::Object ^ sender, Windows::UI::Core::BackRequestedEventArgs ^ args); -#elif SDL_WINAPI_FAMILY_PHONE - void OnBackButtonPressed(Platform::Object ^ sender, Windows::Phone::UI::Input::BackPressedEventArgs ^ args); -#endif - -#if NTDDI_VERSION >= NTDDI_WIN10 - void OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ gamepad); -#endif - - private: - bool m_windowClosed; - bool m_windowVisible; -}; - -extern SDL_WinRTApp ^ SDL_WinRTGlobalApp; diff --git a/src/core/winrt/SDL_winrtapp_xaml.cpp b/src/core/winrt/SDL_winrtapp_xaml.cpp deleted file mode 100644 index 876c73a89..000000000 --- a/src/core/winrt/SDL_winrtapp_xaml.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -// Windows includes -#include -#include - -#if WINAPI_FAMILY == WINAPI_FAMILY_APP -#include -#endif - -// SDL includes -#include "../../video/winrt/SDL_winrtevents_c.h" -#include "../../video/winrt/SDL_winrtvideo_cpp.h" -#include "SDL_winrtapp_common.h" -#include "SDL_winrtapp_xaml.h" - -// SDL-internal globals: -bool WINRT_XAMLWasEnabled = false; - -#if WINAPI_FAMILY == WINAPI_FAMILY_APP -extern "C" ISwapChainBackgroundPanelNative *WINRT_GlobalSwapChainBackgroundPanelNative = NULL; -static Windows::Foundation::EventRegistrationToken WINRT_XAMLAppEventToken; -#endif - -/* - * Input event handlers (XAML) - */ -#if WINAPI_FAMILY == WINAPI_FAMILY_APP - -static void WINRT_OnPointerPressedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) -{ - WINRT_ProcessPointerPressedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); -} - -static void WINRT_OnPointerMovedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) -{ - WINRT_ProcessPointerMovedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); -} - -static void WINRT_OnPointerReleasedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) -{ - WINRT_ProcessPointerReleasedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); -} - -static void WINRT_OnPointerWheelChangedViaXAML(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ args) -{ - WINRT_ProcessPointerWheelChangedEvent(WINRT_GlobalSDLWindow, args->GetCurrentPoint(nullptr)); -} - -#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP - -/* - * XAML-to-SDL Rendering Callback - */ -#if WINAPI_FAMILY == WINAPI_FAMILY_APP - -static void WINRT_OnRenderViaXAML(_In_ Platform::Object ^ sender, _In_ Platform::Object ^ args) -{ - WINRT_CycleXAMLThread(); -} - -#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP - -/* - * SDL + XAML Initialization - */ - -bool SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void *backgroundPanelAsIInspectable) -{ -#if SDL_WINAPI_FAMILY_PHONE - return SDL_SetError("XAML support is not yet available in Windows Phone."); -#else - // Declare C++/CX namespaces: - using namespace Platform; - using namespace Windows::Foundation; - using namespace Windows::UI::Core; - using namespace Windows::UI::Xaml; - using namespace Windows::UI::Xaml::Controls; - using namespace Windows::UI::Xaml::Input; - using namespace Windows::UI::Xaml::Media; - - // Make sure we have a valid XAML element (to draw onto): - if (!backgroundPanelAsIInspectable) { - return SDL_InvalidParamError("backgroundPanelAsIInspectable"); - } - - Platform::Object ^ backgroundPanel = reinterpret_cast((IInspectable *)backgroundPanelAsIInspectable); - SwapChainBackgroundPanel ^ swapChainBackgroundPanel = dynamic_cast(backgroundPanel); - if (!swapChainBackgroundPanel) { - return SDL_SetError("An unknown or unsupported type of XAML control was specified."); - } - - // Setup event handlers: - swapChainBackgroundPanel->PointerPressed += ref new PointerEventHandler(WINRT_OnPointerPressedViaXAML); - swapChainBackgroundPanel->PointerReleased += ref new PointerEventHandler(WINRT_OnPointerReleasedViaXAML); - swapChainBackgroundPanel->PointerWheelChanged += ref new PointerEventHandler(WINRT_OnPointerWheelChangedViaXAML); - swapChainBackgroundPanel->PointerMoved += ref new PointerEventHandler(WINRT_OnPointerMovedViaXAML); - - // Setup for rendering: - IInspectable *panelInspectable = (IInspectable *)reinterpret_cast(swapChainBackgroundPanel); - panelInspectable->QueryInterface(__uuidof(ISwapChainBackgroundPanelNative), (void **)&WINRT_GlobalSwapChainBackgroundPanelNative); - - WINRT_XAMLAppEventToken = CompositionTarget::Rendering::add(ref new EventHandler(WINRT_OnRenderViaXAML)); - - // Make sure the app is ready to call the SDL-centric main() function: - WINRT_SDLAppEntryPoint = mainFunction; - SDL_SetMainReady(); - - // Make sure video-init knows that we're initializing XAML: - bool oldXAMLWasEnabledValue = WINRT_XAMLWasEnabled; - WINRT_XAMLWasEnabled = true; - - // Make sure video modes are detected now, while we still have access to the WinRT - // CoreWindow. WinRT will not allow the app's CoreWindow to be accessed via the - // SDL/WinRT thread. - if (!SDL_InitSubSystem(SDL_INIT_VIDEO)) { - // SDL_InitSubSystem will, on error, set the SDL error. Let that propagate to - // the caller to here: - WINRT_XAMLWasEnabled = oldXAMLWasEnabledValue; - return false; - } - - // All done, for now. - return true; -#endif // SDL_WINAPI_FAMILY_PHONE -} diff --git a/src/core/winrt/SDL_winrtapp_xaml.h b/src/core/winrt/SDL_winrtapp_xaml.h deleted file mode 100644 index 148e278dc..000000000 --- a/src/core/winrt/SDL_winrtapp_xaml.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifndef SDL_winrtapp_xaml_h_ -#define SDL_winrtapp_xaml_h_ - -#ifdef __cplusplus -extern bool WINRT_XAMLWasEnabled; -extern bool SDL_WinRTInitXAMLApp(int (*mainFunction)(int, char **), void *backgroundPanelAsIInspectable); -#endif // ifdef __cplusplus - -#endif // SDL_winrtapp_xaml_h_ diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c index 4704bdc6e..9d7fc8988 100644 --- a/src/cpuinfo/SDL_cpuinfo.c +++ b/src/cpuinfo/SDL_cpuinfo.c @@ -23,7 +23,7 @@ #include "SDL_cpuinfo_c.h" -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) #include "../core/windows/SDL_windows.h" #endif diff --git a/src/dynapi/SDL_dynapi.h b/src/dynapi/SDL_dynapi.h index 2e8e23832..be52f2c29 100644 --- a/src/dynapi/SDL_dynapi.h +++ b/src/dynapi/SDL_dynapi.h @@ -49,8 +49,6 @@ #define SDL_DYNAMIC_API 0 #elif defined(SDL_PLATFORM_EMSCRIPTEN) // probably not useful on Emscripten. #define SDL_DYNAMIC_API 0 -#elif defined(SDL_BUILDING_WINRT) && SDL_BUILDING_WINRT // probably not useful on WinRT, given current .dll loading restrictions -#define SDL_DYNAMIC_API 0 #elif defined(SDL_PLATFORM_PS2) && SDL_PLATFORM_PS2 #define SDL_DYNAMIC_API 0 #elif defined(SDL_PLATFORM_PSP) && SDL_PLATFORM_PSP diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index e2259e16c..1b9d1b280 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -504,8 +504,6 @@ SDL3_0.0.0 { SDL_GetUserFolder; SDL_GetVersion; SDL_GetVideoDriver; - SDL_GetWinRTDeviceFamily; - SDL_GetWinRTFSPath; SDL_GetWindowAspectRatio; SDL_GetWindowBordersSize; SDL_GetWindowDisplayScale; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index a3ae76136..99d95a43b 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -529,8 +529,6 @@ #define SDL_GetUserFolder SDL_GetUserFolder_REAL #define SDL_GetVersion SDL_GetVersion_REAL #define SDL_GetVideoDriver SDL_GetVideoDriver_REAL -#define SDL_GetWinRTDeviceFamily SDL_GetWinRTDeviceFamily_REAL -#define SDL_GetWinRTFSPath SDL_GetWinRTFSPath_REAL #define SDL_GetWindowAspectRatio SDL_GetWindowAspectRatio_REAL #define SDL_GetWindowBordersSize SDL_GetWindowBordersSize_REAL #define SDL_GetWindowDisplayScale SDL_GetWindowDisplayScale_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index b80ddf874..d7364bc97 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -549,8 +549,6 @@ SDL_DYNAPI_PROC(SDL_Finger**,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),r SDL_DYNAPI_PROC(const char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetVersion,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetVideoDriver,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_WinRT_DeviceFamily,SDL_GetWinRTDeviceFamily,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_GetWinRTFSPath,(SDL_WinRT_Path a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowAspectRatio,(SDL_Window *a, float *b, float *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowBordersSize,(SDL_Window *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(float,SDL_GetWindowDisplayScale,(SDL_Window *a),(a),return) diff --git a/src/dynapi/SDL_dynapi_unsupported.h b/src/dynapi/SDL_dynapi_unsupported.h index ce6864c86..2402eaabb 100644 --- a/src/dynapi/SDL_dynapi_unsupported.h +++ b/src/dynapi/SDL_dynapi_unsupported.h @@ -37,10 +37,6 @@ typedef struct IDirect3DDevice9 IDirect3DDevice9; typedef struct XTaskQueueHandle XTaskQueueHandle; #endif -#ifndef SDL_PLATFORM_WINRT -typedef int SDL_WinRT_DeviceFamily; -typedef int SDL_WinRT_Path; -#endif #ifndef SDL_PLATFORM_GDK typedef struct XUserHandle XUserHandle; #endif diff --git a/src/file/SDL_iostream.c b/src/file/SDL_iostream.c index 59cb47225..f4378b869 100644 --- a/src/file/SDL_iostream.c +++ b/src/file/SDL_iostream.c @@ -20,7 +20,7 @@ */ #include "SDL_internal.h" -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_WINRT) +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) #include "../core/windows/SDL_windows.h" #endif @@ -54,7 +54,7 @@ struct SDL_IOStream #include "../core/android/SDL_android.h" #endif -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_WINRT) +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) typedef struct IOStreamWindowsData { @@ -75,7 +75,7 @@ typedef struct IOStreamWindowsData static bool SDLCALL windows_file_open(IOStreamWindowsData *iodata, const char *filename, const char *mode) { -#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) && !defined(SDL_PLATFORM_WINRT) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) UINT old_error_mode; #endif HANDLE h; @@ -108,7 +108,7 @@ static bool SDLCALL windows_file_open(IOStreamWindowsData *iodata, const char *f if (!iodata->data) { return false; } -#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) && !defined(SDL_PLATFORM_WINRT) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) // Do not open a dialog box if failure old_error_mode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS); @@ -116,17 +116,6 @@ static bool SDLCALL windows_file_open(IOStreamWindowsData *iodata, const char *f { LPWSTR str = WIN_UTF8ToStringW(filename); -#if defined(SDL_PLATFORM_WINRT) - CREATEFILE2_EXTENDED_PARAMETERS extparams; - SDL_zero(extparams); - extparams.dwSize = sizeof(extparams); - extparams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; - h = CreateFile2(str, - (w_right | r_right), - (w_right) ? 0 : FILE_SHARE_READ, - (must_exist | truncate | a_mode), - &extparams); -#else h = CreateFileW(str, (w_right | r_right), (w_right) ? 0 : FILE_SHARE_READ, @@ -134,11 +123,10 @@ static bool SDLCALL windows_file_open(IOStreamWindowsData *iodata, const char *f (must_exist | truncate | a_mode), FILE_ATTRIBUTE_NORMAL, NULL); -#endif SDL_free(str); } -#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) && !defined(SDL_PLATFORM_WINRT) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) // restore old behavior SetErrorMode(old_error_mode); #endif @@ -522,18 +510,10 @@ static SDL_bool SDLCALL mem_close(void *userdata) #if defined(HAVE_STDIO_H) && !defined(SDL_PLATFORM_WINDOWS) static bool IsRegularFileOrPipe(FILE *f) { - #ifdef SDL_PLATFORM_WINRT - struct __stat64 st; - if (_fstat64(_fileno(f), &st) < 0 || - !((st.st_mode & _S_IFMT) == _S_IFREG || (st.st_mode & _S_IFMT) == _S_IFIFO)) { - return false; - } - #else struct stat st; if (fstat(fileno(f), &st) < 0 || !(S_ISREG(st.st_mode) || S_ISFIFO(st.st_mode))) { return false; } - #endif return true; } #endif @@ -624,7 +604,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) } } -#elif defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) || defined(SDL_PLATFORM_WINRT) +#elif defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) IOStreamWindowsData *iodata = (IOStreamWindowsData *) SDL_malloc(sizeof (*iodata)); if (!iodata) { return NULL; @@ -655,10 +635,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) #elif defined(HAVE_STDIO_H) { - #if defined(SDL_PLATFORM_WINRT) - FILE *fp = NULL; - fopen_s(&fp, file, mode); - #elif defined(SDL_PLATFORM_3DS) + #if defined(SDL_PLATFORM_3DS) FILE *fp = N3DS_FileOpen(file, mode); #else FILE *fp = fopen(file, mode); diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp deleted file mode 100644 index fd73b0c6b..000000000 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -/* TODO, WinRT: remove the need to compile this with C++/CX (/ZW) extensions, and if possible, without C++ at all - */ - -#ifdef SDL_PLATFORM_WINRT - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// System dependent filesystem routines - -extern "C" { -#include "../../core/windows/SDL_windows.h" -#include "../SDL_sysfilesystem.h" -} - -#include -#include - -using namespace std; -using namespace Windows::Storage; - -static const wchar_t *SDL_GetWinRTFSPathUNICODE(SDL_WinRT_Path pathType) -{ - switch (pathType) { - case SDL_WINRT_PATH_INSTALLED_LOCATION: - { - static wstring path; - if (path.empty()) { -#if defined(NTDDI_WIN10_19H1) && (NTDDI_VERSION >= NTDDI_WIN10_19H1) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) // Only PC supports mods - // Windows 1903 supports mods, via the EffectiveLocation API - if (Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8, 0)) { - path = Windows::ApplicationModel::Package::Current->EffectiveLocation->Path->Data(); - } else { - path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data(); - } -#else - path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data(); -#endif - } - return path.c_str(); - } - - case SDL_WINRT_PATH_LOCAL_FOLDER: - { - static wstring path; - if (path.empty()) { - path = ApplicationData::Current->LocalFolder->Path->Data(); - } - return path.c_str(); - } - -#if !SDL_WINAPI_FAMILY_PHONE || NTDDI_VERSION > NTDDI_WIN8 - case SDL_WINRT_PATH_ROAMING_FOLDER: - { - static wstring path; - if (path.empty()) { - path = ApplicationData::Current->RoamingFolder->Path->Data(); - } - return path.c_str(); - } - - case SDL_WINRT_PATH_TEMP_FOLDER: - { - static wstring path; - if (path.empty()) { - path = ApplicationData::Current->TemporaryFolder->Path->Data(); - } - return path.c_str(); - } -#endif - - default: - break; - } - - SDL_Unsupported(); - return NULL; -} - -extern "C" const char *SDL_GetWinRTFSPath(SDL_WinRT_Path pathType) -{ - typedef unordered_map UTF8PathMap; - static UTF8PathMap utf8Paths; - - UTF8PathMap::iterator searchResult = utf8Paths.find(pathType); - if (searchResult != utf8Paths.end()) { - return searchResult->second.c_str(); - } - - const wchar_t *ucs2Path = SDL_GetWinRTFSPathUNICODE(pathType); - if (!ucs2Path) { - return NULL; - } - - char *utf8Path = WIN_StringToUTF8W(ucs2Path); - utf8Paths[pathType] = utf8Path; - SDL_free(utf8Path); - return SDL_GetPersistentString(utf8Paths[pathType].c_str()); -} - -extern "C" char *SDL_SYS_GetBasePath(void) -{ - const char *srcPath = SDL_GetWinRTFSPath(SDL_WINRT_PATH_INSTALLED_LOCATION); - size_t destPathLen; - char *destPath = NULL; - - if (!srcPath) { - SDL_SetError("Couldn't locate our basepath: %s", SDL_GetError()); - return NULL; - } - - destPathLen = SDL_strlen(srcPath) + 2; - destPath = (char *)SDL_malloc(destPathLen); - if (!destPath) { - return NULL; - } - - SDL_snprintf(destPath, destPathLen, "%s\\", srcPath); - return destPath; -} - -extern "C" char *SDL_SYS_GetPrefPath(const char *org, const char *app) -{ - /* WinRT note: The 'SHGetFolderPath' API that is used in Windows 7 and - * earlier is not available on WinRT or Windows Phone. WinRT provides - * a similar API, but SHGetFolderPath can't be called, at least not - * without violating Microsoft's app-store requirements. - */ - - const WCHAR *srcPath = NULL; - WCHAR path[MAX_PATH]; - char *result = NULL; - WCHAR *worg = NULL; - WCHAR *wapp = NULL; - size_t new_wpath_len = 0; - BOOL api_result = FALSE; - - if (!app) { - SDL_InvalidParamError("app"); - return NULL; - } - if (!org) { - org = ""; - } - - srcPath = SDL_GetWinRTFSPathUNICODE(SDL_WINRT_PATH_LOCAL_FOLDER); - if (!srcPath) { - SDL_SetError("Unable to find a source path"); - return NULL; - } - - if (SDL_wcslen(srcPath) >= MAX_PATH) { - SDL_SetError("Path too long."); - return NULL; - } - SDL_wcslcpy(path, srcPath, SDL_arraysize(path)); - - worg = WIN_UTF8ToStringW(org); - if (!worg) { - return NULL; - } - - wapp = WIN_UTF8ToStringW(app); - if (!wapp) { - SDL_free(worg); - return NULL; - } - - new_wpath_len = SDL_wcslen(worg) + SDL_wcslen(wapp) + SDL_wcslen(path) + 3; - - if ((new_wpath_len + 1) > MAX_PATH) { - SDL_free(worg); - SDL_free(wapp); - SDL_SetError("Path too long."); - return NULL; - } - - if (*worg) { - SDL_wcslcat(path, L"\\", new_wpath_len + 1); - SDL_wcslcat(path, worg, new_wpath_len + 1); - SDL_free(worg); - } - - api_result = CreateDirectoryW(path, NULL); - if (api_result == FALSE) { - if (GetLastError() != ERROR_ALREADY_EXISTS) { - SDL_free(wapp); - WIN_SetError("Couldn't create a prefpath."); - return NULL; - } - } - - SDL_wcslcat(path, L"\\", new_wpath_len + 1); - SDL_wcslcat(path, wapp, new_wpath_len + 1); - SDL_free(wapp); - - api_result = CreateDirectoryW(path, NULL); - if (api_result == FALSE) { - if (GetLastError() != ERROR_ALREADY_EXISTS) { - WIN_SetError("Couldn't create a prefpath."); - return NULL; - } - } - - SDL_wcslcat(path, L"\\", new_wpath_len + 1); - - result = WIN_StringToUTF8W(path); - - return result; -} - -char *SDL_SYS_GetUserFolder(SDL_Folder folder) -{ - wstring wpath; - - switch (folder) { - #define CASEPATH(sym, var) case sym: wpath = Windows::Storage::UserDataPaths::GetDefault()->var->Data(); break - CASEPATH(SDL_FOLDER_HOME, Profile); - CASEPATH(SDL_FOLDER_DESKTOP, Desktop); - CASEPATH(SDL_FOLDER_DOCUMENTS, Documents); - CASEPATH(SDL_FOLDER_DOWNLOADS, Downloads); - CASEPATH(SDL_FOLDER_MUSIC, Music); - CASEPATH(SDL_FOLDER_PICTURES, Pictures); - CASEPATH(SDL_FOLDER_SCREENSHOTS, Screenshots); - CASEPATH(SDL_FOLDER_TEMPLATES, Templates); - CASEPATH(SDL_FOLDER_VIDEOS, Videos); - #undef CASEPATH - #define UNSUPPPORTED_CASEPATH(sym) SDL_SetError("The %s folder is unsupported on WinRT", #sym); return NULL; - UNSUPPPORTED_CASEPATH(SDL_FOLDER_PUBLICSHARE); - UNSUPPPORTED_CASEPATH(SDL_FOLDER_SAVEDGAMES); - #undef UNSUPPPORTED_CASEPATH - default: - SDL_SetError("Invalid SDL_Folder: %d", (int)folder); - return NULL; - }; - - wpath += L"\\"; - - return WIN_StringToUTF8W(wpath.c_str()); -} - -#endif // SDL_PLATFORM_WINRT diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c index c3a98dacb..d7d173f47 100644 --- a/src/gpu/d3d12/SDL_gpu_d3d12.c +++ b/src/gpu/d3d12/SDL_gpu_d3d12.c @@ -6248,11 +6248,9 @@ static bool D3D12_INTERNAL_CreateSwapchain( swapchainDesc.Flags = 0; } -#ifndef SDL_PLATFORM_WINRT if (!IsWindow(dxgiHandle)) { return false; } -#endif // Create the swapchain! res = IDXGIFactory4_CreateSwapChainForHwnd( diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 5c43fbadf..1e37ea4c8 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -832,9 +832,6 @@ int SDL_GetJoystickPlayerIndexForID(SDL_JoystickID instance_id) */ static bool SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick) { -#ifdef SDL_PLATFORM_WINRT - return true; -#else // printf("JOYSTICK '%s' VID/PID 0x%.4x/0x%.4x AXES: %d\n", joystick->name, vendor, product, joystick->naxes); if (joystick->naxes == 2) { @@ -843,7 +840,6 @@ static bool SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick) } return SDL_VIDPIDInList(SDL_GetJoystickVendor(joystick), SDL_GetJoystickProduct(joystick), &zero_centered_devices); -#endif // SDL_PLATFORM_WINRT } static bool IsROGAlly(SDL_Joystick *joystick) diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index b87d34517..b05361063 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -686,13 +686,8 @@ static void RAWINPUT_InitWindowsGamingInput(RAWINPUT_DeviceContext *ctx) typedef HRESULT(WINAPI * WindowsCreateStringReference_t)(PCWSTR sourceString, UINT32 length, HSTRING_HEADER * hstringHeader, HSTRING * string); typedef HRESULT(WINAPI * RoGetActivationFactory_t)(HSTRING activatableClassId, REFIID iid, void **factory); -#ifdef SDL_PLATFORM_WINRT - WindowsCreateStringReference_t WindowsCreateStringReferenceFunc = WindowsCreateStringReference; - RoGetActivationFactory_t RoGetActivationFactoryFunc = RoGetActivationFactory; -#else WindowsCreateStringReference_t WindowsCreateStringReferenceFunc = (WindowsCreateStringReference_t)WIN_LoadComBaseFunction("WindowsCreateStringReference"); RoGetActivationFactory_t RoGetActivationFactoryFunc = (RoGetActivationFactory_t)WIN_LoadComBaseFunction("RoGetActivationFactory"); -#endif if (WindowsCreateStringReferenceFunc && RoGetActivationFactoryFunc) { PCWSTR pNamespace = L"Windows.Gaming.Input.Gamepad"; HSTRING_HEADER hNamespaceStringHeader; diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c index 55cf23daf..7aa5c6491 100644 --- a/src/joystick/windows/SDL_windows_gaming_input.c +++ b/src/joystick/windows/SDL_windows_gaming_input.c @@ -88,9 +88,8 @@ static struct WindowsGamingInputControllerState *controllers; } wgi; -/* WinRT headers in official Windows SDK contain only declarations, and we have to define these GUIDs ourselves. - * https://stackoverflow.com/a/55605485/1795050 - */ +// WinRT headers in official Windows SDK contain only declarations, and we have to define these GUIDs ourselves. +// https://stackoverflow.com/a/55605485/1795050 DEFINE_GUID(IID___FIEventHandler_1_Windows__CGaming__CInput__CRawGameController, 0x00621c22, 0x42e8, 0x529f, 0x92, 0x70, 0x83, 0x6b, 0x32, 0x93, 0x1d, 0x72); DEFINE_GUID(IID___x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics, 0x5c37b8c8, 0x37b1, 0x4ad8, 0x94, 0x58, 0x20, 0x0f, 0x1a, 0x30, 0x01, 0x8e); DEFINE_GUID(IID___x_ABI_CWindows_CGaming_CInput_CIArcadeStickStatics2, 0x52b5d744, 0xbb86, 0x445a, 0xb5, 0x9c, 0x59, 0x6f, 0x0e, 0x2a, 0x49, 0xdf); @@ -592,13 +591,6 @@ static bool WGI_JoystickInit(void) return SDL_SetError("RoInitialize() failed"); } -#ifdef SDL_PLATFORM_WINRT - wgi.CoIncrementMTAUsage = CoIncrementMTAUsage; - wgi.RoGetActivationFactory = RoGetActivationFactory; - wgi.WindowsCreateStringReference = WindowsCreateStringReference; - wgi.WindowsDeleteString = WindowsDeleteString; - wgi.WindowsGetStringRawBuffer = WindowsGetStringRawBuffer; -#else #define RESOLVE(x) wgi.x = (x##_t)WIN_LoadComBaseFunction(#x); if (!wgi.x) return WIN_SetError("GetProcAddress failed for " #x); RESOLVE(CoIncrementMTAUsage); RESOLVE(RoGetActivationFactory); @@ -606,9 +598,7 @@ static bool WGI_JoystickInit(void) RESOLVE(WindowsDeleteString); RESOLVE(WindowsGetStringRawBuffer); #undef RESOLVE -#endif // SDL_PLATFORM_WINRT -#ifndef SDL_PLATFORM_WINRT { /* There seems to be a bug in Windows where a dependency of WGI can be unloaded from memory prior to WGI itself. * This results in Windows_Gaming_Input!GameController::~GameController() invoking an unloaded DLL and crashing. @@ -623,7 +613,6 @@ static bool WGI_JoystickInit(void) } } } -#endif WGI_LoadRawGameControllerStatics(); diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c index 727ff7c28..1d724618b 100644 --- a/src/joystick/windows/SDL_windowsjoystick.c +++ b/src/joystick/windows/SDL_windowsjoystick.c @@ -36,7 +36,7 @@ #include "../../thread/SDL_systhread.h" #include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_hid.h" -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) #include #endif @@ -79,7 +79,7 @@ void WINDOWS_RAWINPUTEnabledChanged(void) SetWindowsDeviceChanged(); } -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) typedef struct { @@ -211,9 +211,7 @@ static bool SDL_WaitForDeviceNotification(SDL_DeviceNotificationData *data, SDL_ return (lastret != -1); } -#endif // !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - -#ifndef SDL_PLATFORM_WINRT +#endif // !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) static SDL_DeviceNotificationData s_notification_data; @@ -320,8 +318,6 @@ static void SDL_StopJoystickThread(void) s_joystickThread = NULL; } -#endif // !defined(SDL_PLATFORM_WINRT) - void WINDOWS_AddJoystickDevice(JoyStick_DeviceData *device) { device->send_add_event = true; @@ -348,7 +344,7 @@ static bool WINDOWS_JoystickInit(void) WIN_InitDeviceNotification(); -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) s_bJoystickThread = SDL_GetHintBoolean(SDL_HINT_JOYSTICK_THREAD, false); if (s_bJoystickThread) { if (!SDL_StartJoystickThread()) { @@ -639,7 +635,7 @@ void WINDOWS_JoystickQuit(void) } SYS_Joystick = NULL; -#if !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) if (s_bJoystickThread) { SDL_StopJoystickThread(); } else { diff --git a/src/loadso/windows/SDL_sysloadso.c b/src/loadso/windows/SDL_sysloadso.c index e4081af2e..b069a9c32 100644 --- a/src/loadso/windows/SDL_sysloadso.c +++ b/src/loadso/windows/SDL_sysloadso.c @@ -29,23 +29,13 @@ void *SDL_LoadObject(const char *sofile) { - void *handle; - LPWSTR wstr; - if (!sofile) { SDL_InvalidParamError("sofile"); return NULL; } - wstr = WIN_UTF8ToStringW(sofile); -#ifdef SDL_PLATFORM_WINRT - /* WinRT only publicly supports LoadPackagedLibrary() for loading .dll - files. LoadLibrary() is a private API, and not available for apps - (that can be published to MS' Windows Store.) - */ - handle = (void *)LoadPackagedLibrary(wstr, 0); -#else - handle = (void *)LoadLibrary(wstr); -#endif + + LPWSTR wstr = WIN_UTF8ToStringW(sofile); + void *handle = (void *)LoadLibrary(wstr); SDL_free(wstr); // Generate an error message if all loads failed diff --git a/src/locale/winrt/SDL_syslocale.c b/src/locale/winrt/SDL_syslocale.c deleted file mode 100644 index 1ad9756e5..000000000 --- a/src/locale/winrt/SDL_syslocale.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include - -#include "../SDL_syslocale.h" - -// using namespace Windows::Graphics::Display; -#include - -bool SDL_SYS_GetPreferredLocales(char *buf, size_t buflen) -{ - WCHAR wbuffer[128] = L""; - int rc = 0; - - // !!! FIXME: do we not have GetUserPreferredUILanguages on WinPhone or UWP? -#if SDL_WINAPI_FAMILY_PHONE - rc = GetLocaleInfoEx(LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_SNAME, wbuffer, SDL_arraysize(wbuffer)); -#else - rc = GetSystemDefaultLocaleName(wbuffer, SDL_arraysize(wbuffer)); -#endif - - if (rc > 0) { - // Need to convert LPWSTR to LPSTR, that is wide char to char. - int i; - - if (((size_t)rc) >= (buflen - 1)) { - rc = (int)(buflen - 1); - } - for (i = 0; i < rc; i++) { - buf[i] = (char)wbuffer[i]; // assume this was ASCII anyhow. - } - } - return true; -} diff --git a/src/main/winrt/SDL3-WinRTResource_BlankCursor.cur b/src/main/winrt/SDL3-WinRTResource_BlankCursor.cur deleted file mode 100644 index c6556b8a72d272dc9b47f2194b05a1bc022f80a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 326 zcmc(Zu@L|u2m>F6u%@(h1V?jo3_1k4`wy22aEu6KV;Kx!3QcTLd*wWTxvHpS=06&( HA6jz(2=#;* diff --git a/src/main/winrt/SDL3-WinRTResources.rc b/src/main/winrt/SDL3-WinRTResources.rc deleted file mode 100644 index a923a1196..000000000 --- a/src/main/winrt/SDL3-WinRTResources.rc +++ /dev/null @@ -1,2 +0,0 @@ -#include "winres.h" -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 5000 CURSOR "SDL3-WinRTResource_BlankCursor.cur" diff --git a/src/main/winrt/SDL_sysmain_runapp.cpp b/src/main/winrt/SDL_sysmain_runapp.cpp deleted file mode 100644 index a69509d01..000000000 --- a/src/main/winrt/SDL_sysmain_runapp.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../../core/winrt/SDL_winrtapp_direct3d.h" -#include "../../core/winrt/SDL_winrtapp_xaml.h" - -#include - -extern "C" -int SDL_RunApp(int, char**, SDL_main_func mainFunction, void * xamlBackgroundPanel) -{ - if (xamlBackgroundPanel) { - if (!SDL_WinRTInitXAMLApp(mainFunction, xamlBackgroundPanel)) { - return 1; - } - } else { - if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) { - return 1; - } - if (!SDL_WinRTInitNonXAMLApp(mainFunction)) { - return 1; - } - } - return 0; -} - diff --git a/src/misc/winrt/SDL_sysurl.cpp b/src/misc/winrt/SDL_sysurl.cpp deleted file mode 100644 index 0026e615e..000000000 --- a/src/misc/winrt/SDL_sysurl.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include "../SDL_sysurl.h" -#include "../../core/windows/SDL_windows.h" - -bool SDL_SYS_OpenURL(const char *url) -{ - WCHAR *wurl = WIN_UTF8ToStringW(url); - if (!wurl) { - return false; - } - auto strurl = ref new Platform::String(wurl); - SDL_free(wurl); - - auto uri = ref new Windows::Foundation::Uri(strurl); - Windows::System::Launcher::LaunchUriAsync(uri); - return true; // oh well, we're not waiting on an async task here. -} diff --git a/src/power/SDL_power.c b/src/power/SDL_power.c index 255cecf38..b42e4f7f0 100644 --- a/src/power/SDL_power.c +++ b/src/power/SDL_power.c @@ -71,9 +71,6 @@ static SDL_GetPowerInfo_Impl implementations[] = { #ifdef SDL_POWER_N3DS // handles N3DS. SDL_GetPowerInfo_N3DS, #endif -#ifdef SDL_POWER_WINRT // handles WinRT - SDL_GetPowerInfo_WinRT, -#endif #ifdef SDL_POWER_EMSCRIPTEN // handles Emscripten SDL_GetPowerInfo_Emscripten, #endif diff --git a/src/power/SDL_syspower.h b/src/power/SDL_syspower.h index f62ebf6ab..3af0bacaa 100644 --- a/src/power/SDL_syspower.h +++ b/src/power/SDL_syspower.h @@ -38,7 +38,6 @@ bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *); bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *); bool SDL_GetPowerInfo_VITA(SDL_PowerState *, int *, int *); bool SDL_GetPowerInfo_N3DS(SDL_PowerState *, int *, int *); -bool SDL_GetPowerInfo_WinRT(SDL_PowerState *, int *, int *); bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *, int *, int *); // this one is static in SDL_power.c diff --git a/src/power/winrt/SDL_syspower.cpp b/src/power/winrt/SDL_syspower.cpp deleted file mode 100644 index 031e0073f..000000000 --- a/src/power/winrt/SDL_syspower.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifndef SDL_POWER_DISABLED -#if SDL_POWER_WINRT - -extern "C" bool -SDL_GetPowerInfo_WinRT(SDL_PowerState *state, int *seconds, int *percent) -{ - // TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement SDL_GetPowerInfo_WinRT as appropriate. - /* Notes: - - the Win32 function, GetSystemPowerStatus, is not available for use on WinRT - - Windows Phone 8 has a 'Battery' class, which is documented as available for C++ - - More info on WP8's Battery class can be found at http://msdn.microsoft.com/library/windowsphone/develop/jj207231 - */ - return false; -} - -#endif // SDL_POWER_WINRT -#endif // SDL_POWER_DISABLED diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 66fd7ab2e..af5ae6f70 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -24,9 +24,7 @@ #define COBJMACROS #include "../../core/windows/SDL_windows.h" -#ifndef SDL_PLATFORM_WINRT #include "../../video/windows/SDL_windowswindow.h" -#endif #include "../SDL_sysrender.h" #include "../SDL_d3dmath.h" #include "../../video/SDL_pixels_c.h" @@ -37,22 +35,6 @@ #include "SDL_shaders_d3d11.h" -#ifdef SDL_PLATFORM_WINRT - -#if NTDDI_VERSION > NTDDI_WIN8 -#include -#endif - -#include "SDL_render_winrt.h" - -#if WINAPI_FAMILY == WINAPI_FAMILY_APP -#include -// TODO, WinRT, XAML: get the ISwapChainBackgroundPanelNative from something other than a global var -extern ISwapChainBackgroundPanelNative *WINRT_GlobalSwapChainBackgroundPanelNative; -#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP - -#endif // SDL_PLATFORM_WINRT - #if defined(_MSC_VER) && !defined(__clang__) #define SDL_COMPOSE_ERROR(str) __FUNCTION__ ", " str #else @@ -222,14 +204,7 @@ typedef struct int currentVertexBuffer; } D3D11_RenderData; -/* Define D3D GUIDs here so we don't have to include uuid.lib. - * - * Fix for SDL bug https://bugzilla.libsdl.org/show_bug.cgi?id=3437: - * The extra 'SDL_' was added to the start of each IID's name, in order - * to prevent build errors on both MinGW-w64 and WinRT/UWP. - * (SDL bug https://bugzilla.libsdl.org/show_bug.cgi?id=3336 led to - * linker errors in WinRT/UWP builds.) - */ +// Define D3D GUIDs here so we don't have to include uuid.lib. #ifdef HAVE_GCC_DIAGNOSTIC_PRAGMA #pragma GCC diagnostic push @@ -238,9 +213,6 @@ typedef struct static const GUID SDL_IID_IDXGIFactory2 = { 0x50c83a1c, 0xe072, 0x4c48, { 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0 } }; static const GUID SDL_IID_IDXGIDevice1 = { 0x77db970f, 0x6276, 0x48ba, { 0xba, 0x28, 0x07, 0x01, 0x43, 0xb4, 0x39, 0x2c } }; -#if defined(SDL_PLATFORM_WINRT) && NTDDI_VERSION > NTDDI_WIN8 -static const GUID SDL_IID_IDXGIDevice3 = { 0x6007896c, 0x3244, 0x4afd, { 0xbf, 0x18, 0xa6, 0xd3, 0xbe, 0xda, 0x50, 0x23 } }; -#endif static const GUID SDL_IID_ID3D11Texture2D = { 0x6f15aaf2, 0xd208, 0x4e89, { 0x9a, 0xb4, 0x48, 0x95, 0x35, 0xd3, 0x4f, 0x9c } }; static const GUID SDL_IID_ID3D11Device1 = { 0xa04bfb29, 0x08ef, 0x43d6, { 0xa4, 0x9c, 0xa9, 0xbd, 0xbd, 0xcb, 0xe6, 0x86 } }; static const GUID SDL_IID_ID3D11DeviceContext1 = { 0xbb2c6faa, 0xb5fb, 0x4082, { 0x8e, 0x6b, 0x38, 0x8b, 0x8c, 0xfa, 0x90, 0xe1 } }; @@ -555,10 +527,6 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) // See if we need debug interfaces createDebug = SDL_GetHintBoolean(SDL_HINT_RENDER_DIRECT3D11_DEBUG, false); -#ifdef SDL_PLATFORM_WINRT - CreateDXGIFactory2Func = CreateDXGIFactory2; - D3D11CreateDeviceFunc = D3D11CreateDevice; -#else data->hDXGIMod = SDL_LoadObject("dxgi.dll"); if (!data->hDXGIMod) { result = E_FAIL; @@ -585,7 +553,6 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) result = E_FAIL; goto done; } -#endif // SDL_PLATFORM_WINRT if (createDebug) { #ifdef __IDXGIInfoQueue_INTERFACE_DEFINED__ @@ -897,13 +864,7 @@ static bool D3D11_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Re static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; -#ifdef SDL_PLATFORM_WINRT - IUnknown *coreWindow = D3D11_GetCoreWindowFromSDLRenderer(renderer); - const BOOL usingXAML = (!coreWindow); -#else IUnknown *coreWindow = NULL; - const BOOL usingXAML = FALSE; -#endif IDXGISwapChain3 *swapChain3 = NULL; HRESULT result = S_OK; @@ -928,19 +889,10 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) swapChainDesc.SampleDesc.Quality = 0; swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc.BufferCount = 2; // Use double-buffering to minimize latency. -#if SDL_WINAPI_FAMILY_PHONE - swapChainDesc.Scaling = DXGI_SCALING_STRETCH; // On phone, only stretch and aspect-ratio stretch scaling are allowed. - swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; // On phone, no swap effects are supported. - // TODO, WinRT: see if Win 8.x DXGI_SWAP_CHAIN_DESC1 settings are available on Windows Phone 8.1, and if there's any advantage to having them on -#else - if (usingXAML) { - swapChainDesc.Scaling = DXGI_SCALING_STRETCH; + if (WIN_IsWindows8OrGreater()) { + swapChainDesc.Scaling = DXGI_SCALING_NONE; } else { - if (WIN_IsWindows8OrGreater()) { - swapChainDesc.Scaling = DXGI_SCALING_NONE; - } else { - swapChainDesc.Scaling = DXGI_SCALING_STRETCH; - } + swapChainDesc.Scaling = DXGI_SCALING_STRETCH; } if (SDL_GetWindowFlags(renderer->window) & SDL_WINDOW_TRANSPARENT) { swapChainDesc.Scaling = DXGI_SCALING_STRETCH; @@ -948,7 +900,6 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) } else { swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // All Windows Store apps must use this SwapEffect. } -#endif swapChainDesc.Flags = 0; if (coreWindow) { @@ -962,28 +913,6 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory2::CreateSwapChainForCoreWindow"), result); goto done; } - } else if (usingXAML) { - result = IDXGIFactory2_CreateSwapChainForComposition(data->dxgiFactory, - (IUnknown *)data->d3dDevice, - &swapChainDesc, - NULL, - &data->swapChain); - if (FAILED(result)) { - WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory2::CreateSwapChainForComposition"), result); - goto done; - } - -#if WINAPI_FAMILY == WINAPI_FAMILY_APP - result = ISwapChainBackgroundPanelNative_SetSwapChain(WINRT_GlobalSwapChainBackgroundPanelNative, (IDXGISwapChain *)data->swapChain); - if (FAILED(result)) { - WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ISwapChainBackgroundPanelNative::SetSwapChain"), result); - goto done; - } -#else - SDL_SetError(SDL_COMPOSE_ERROR("XAML support is not yet available for Windows Phone")); - result = E_FAIL; - goto done; -#endif } else { #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); @@ -1102,11 +1031,7 @@ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer) /* The width and height of the swap chain must be based on the display's * non-rotated size. */ -#ifdef SDL_PLATFORM_WINRT - SDL_GetWindowSize(renderer->window, &w, &h); -#else SDL_GetWindowSizeInPixels(renderer->window, &w, &h); -#endif data->rotation = D3D11_GetCurrentRotation(); // SDL_Log("%s: windowSize={%d,%d}, orientation=%d\n", __FUNCTION__, w, h, (int)data->rotation); if (D3D11_IsDisplayRotated90Degrees(data->rotation)) { @@ -1116,8 +1041,6 @@ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer) } if (data->swapChain) { - // IDXGISwapChain::ResizeBuffers is not available on Windows Phone 8. -#if !defined(SDL_PLATFORM_WINRT) || !SDL_WINAPI_FAMILY_PHONE // If the swap chain already exists, resize it. result = IDXGISwapChain_ResizeBuffers(data->swapChain, 0, @@ -1136,7 +1059,6 @@ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer) WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain::ResizeBuffers"), result); goto done; } -#endif } else { result = D3D11_CreateSwapChain(renderer, w, h); if (FAILED(result) || !data->swapChain) { @@ -1144,23 +1066,7 @@ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer) } } -#if !SDL_WINAPI_FAMILY_PHONE - /* Set the proper rotation for the swap chain. - * - * To note, the call for this, IDXGISwapChain1::SetRotation, is not necessary - * on Windows Phone 8.0, nor is it supported there. - * - * IDXGISwapChain1::SetRotation does seem to be available on Windows Phone 8.1, - * however I've yet to find a way to make it work. It might have something to - * do with IDXGISwapChain::ResizeBuffers appearing to not being available on - * Windows Phone 8.1 (it wasn't on Windows Phone 8.0), but I'm not 100% sure of this. - * The call doesn't appear to be entirely necessary though, and is a performance-related - * call, at least according to the following page on MSDN: - * http://code.msdn.microsoft.com/windowsapps/DXGI-swap-chain-rotation-21d13d71 - * -- David L. - * - * TODO, WinRT: reexamine the docs for IDXGISwapChain1::SetRotation, see if might be available, usable, and prudent-to-call on WinPhone 8.1 - */ + // Set the proper rotation for the swap chain. if (WIN_IsWindows8OrGreater()) { if (data->swapEffect == DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL) { result = IDXGISwapChain1_SetRotation(data->swapChain, data->rotation); @@ -1170,7 +1076,6 @@ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer) } } } -#endif result = IDXGISwapChain_GetBuffer(data->swapChain, 0, @@ -1213,26 +1118,6 @@ static HRESULT D3D11_UpdateForWindowSizeChange(SDL_Renderer *renderer) return D3D11_CreateWindowSizeDependentResources(renderer); } -void D3D11_Trim(SDL_Renderer *renderer) -{ -#ifdef SDL_PLATFORM_WINRT -#if NTDDI_VERSION > NTDDI_WIN8 - D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; - HRESULT result = S_OK; - IDXGIDevice3 *dxgiDevice = NULL; - - result = ID3D11Device_QueryInterface(data->d3dDevice, &SDL_IID_IDXGIDevice3, &dxgiDevice); - if (FAILED(result)) { - // WIN_SetErrorFromHRESULT(__FUNCTION__ ", ID3D11Device to IDXGIDevice3", result); - return; - } - - IDXGIDevice3_Trim(dxgiDevice); - SAFE_RELEASE(dxgiDevice); -#endif -#endif -} - static void D3D11_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; @@ -1835,8 +1720,6 @@ static bool D3D11_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, * have the ability to write a CPU-bound pixel buffer to a rectangular * subrect of a texture. Direct3D 11.1 can, however, write a pixel * buffer to an entire texture, hence the use of a staging texture. - * - * TODO, WinRT: consider avoiding the use of a staging texture in D3D11_LockTexture if/when the entire texture is being updated */ ID3D11Texture2D_GetDesc(textureData->mainTexture, &stagingTextureDesc); stagingTextureDesc.Width = rect->w; @@ -2183,7 +2066,6 @@ static bool D3D11_UpdateViewport(SDL_Renderer *renderer) orientationAlignedViewport.w = (float)viewport->w; orientationAlignedViewport.h = (float)viewport->h; } - // TODO, WinRT: get custom viewports working with non-Landscape modes (Portrait, PortraitFlipped, and LandscapeFlipped) d3dviewport.TopLeftX = orientationAlignedViewport.x; d3dviewport.TopLeftY = orientationAlignedViewport.y; @@ -2736,15 +2618,10 @@ static bool D3D11_RenderPresent(SDL_Renderer *renderer) SDL_zero(parameters); -#if SDL_WINAPI_FAMILY_PHONE - result = IDXGISwapChain_Present(data->swapChain, data->syncInterval, data->presentFlags); -#else /* The application may optionally specify "dirty" or "scroll" * rects to improve efficiency in certain scenarios. - * This option is not available on Windows Phone 8, to note. */ result = IDXGISwapChain1_Present1(data->swapChain, data->syncInterval, data->presentFlags, ¶meters); -#endif /* Discard the contents of the render target. * This is a valid operation only when the existing contents will be entirely @@ -2758,8 +2635,6 @@ static bool D3D11_RenderPresent(SDL_Renderer *renderer) if (FAILED(result) && result != DXGI_ERROR_WAS_STILL_DRAWING) { /* If the device was removed either by a disconnect or a driver upgrade, we * must recreate all device resources. - * - * TODO, WinRT: consider throwing an exception if D3D11_RenderPresent fails, especially if there is a way to salvage debug info from users' machines */ if (result == DXGI_ERROR_DEVICE_REMOVED) { D3D11_HandleDeviceLost(renderer); @@ -2778,22 +2653,6 @@ static bool D3D11_SetVSync(SDL_Renderer *renderer, const int vsync) { D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; -#if SDL_WINAPI_FAMILY_PHONE - /* VSync is required in Windows Phone, at least for Win Phone 8.0 and 8.1. - * Failure to use it seems to either result in: - * - * - with the D3D11 debug runtime turned OFF, vsync seemingly gets turned - * off (framerate doesn't get capped), but nothing appears on-screen - * - * - with the D3D11 debug runtime turned ON, vsync gets automatically - * turned back on, and the following gets output to the debug console: - * - * DXGI ERROR: IDXGISwapChain::Present: Interval 0 is not supported, changed to Interval 1. [ UNKNOWN ERROR #1024: ] - */ - if (vsync == 0) { - return SDL_Unsupported(); - } -#endif if (vsync < 0) { return SDL_Unsupported(); } diff --git a/src/render/direct3d11/SDL_render_winrt.cpp b/src/render/direct3d11/SDL_render_winrt.cpp deleted file mode 100644 index c148f9117..000000000 --- a/src/render/direct3d11/SDL_render_winrt.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_RENDER_D3D11 - -#include "../../video/winrt/SDL_winrtvideo_cpp.h" -extern "C" { -#include "../SDL_sysrender.h" -} - -#include -#include - -#if WINAPI_FAMILY == WINAPI_FAMILY_APP -#include -#endif - -using namespace Windows::UI::Core; -using namespace Windows::Graphics::Display; - -#include - -#include "SDL_render_winrt.h" - -extern "C" void * -D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer *renderer) -{ - IInspectable *window = (IInspectable *)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, NULL); - ABI::Windows::UI::Core::ICoreWindow *coreWindow = NULL; - if (!window || FAILED(window->QueryInterface(&coreWindow))) { - return NULL; - } - - IUnknown *coreWindowAsIUnknown = NULL; - coreWindow->QueryInterface(&coreWindowAsIUnknown); - coreWindow->Release(); - - return coreWindowAsIUnknown; -} - -extern "C" DXGI_MODE_ROTATION -D3D11_GetCurrentRotation() -{ - const DisplayOrientations currentOrientation = WINRT_DISPLAY_PROPERTY(CurrentOrientation); - - switch (currentOrientation) { - -#if SDL_WINAPI_FAMILY_PHONE - // Windows Phone rotations - case DisplayOrientations::Landscape: - return DXGI_MODE_ROTATION_ROTATE90; - case DisplayOrientations::Portrait: - return DXGI_MODE_ROTATION_IDENTITY; - case DisplayOrientations::LandscapeFlipped: - return DXGI_MODE_ROTATION_ROTATE270; - case DisplayOrientations::PortraitFlipped: - return DXGI_MODE_ROTATION_ROTATE180; -#else - // Non-Windows-Phone rotations (ex: Windows 8, Windows RT) - case DisplayOrientations::Landscape: - return DXGI_MODE_ROTATION_IDENTITY; - case DisplayOrientations::Portrait: - return DXGI_MODE_ROTATION_ROTATE270; - case DisplayOrientations::LandscapeFlipped: - return DXGI_MODE_ROTATION_ROTATE180; - case DisplayOrientations::PortraitFlipped: - return DXGI_MODE_ROTATION_ROTATE90; -#endif // SDL_WINAPI_FAMILY_PHONE - } - - return DXGI_MODE_ROTATION_IDENTITY; -} - -#endif // SDL_VIDEO_RENDER_D3D11 diff --git a/src/render/direct3d11/SDL_render_winrt.h b/src/render/direct3d11/SDL_render_winrt.h deleted file mode 100644 index 990f82139..000000000 --- a/src/render/direct3d11/SDL_render_winrt.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_RENDER_D3D11 - -#ifdef __cplusplus -extern "C" { -#endif - -void *D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer *renderer); -DXGI_MODE_ROTATION D3D11_GetCurrentRotation(); - -#ifdef __cplusplus -} -#endif - -#endif // SDL_VIDEO_RENDER_D3D11 diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 7a1bbb938..f78252447 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -2040,16 +2040,6 @@ static bool GLES2_SetVSync(SDL_Renderer *renderer, const int vsync) { int interval = 0; -#ifdef SDL_PLATFORM_WINRT - /* DLudwig, 2013-11-29: ANGLE for WinRT doesn't seem to work unless VSync - * is turned on. Not doing so will freeze the screen's contents to that - * of the first drawn frame. - */ - if (vsync == 0) { - return SDL_Unsupported(); - } -#endif - if (!SDL_GL_SetSwapInterval(vsync)) { return false; } diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index e673dddb4..a20acffd8 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -339,8 +339,8 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread) { - // rather than check this in every backend, just make sure it's correct upfront. Only allow non-NULL if non-WinRT Windows, or Microsoft GDK. - #if (!defined(SDL_PLATFORM_WIN32) && !defined(SDL_PLATFORM_GDK)) || defined(SDL_PLATFORM_WINRT) + // rather than check this in every backend, just make sure it's correct upfront. Only allow non-NULL if Windows, or Microsoft GDK. + #if (!defined(SDL_PLATFORM_WIN32) && !defined(SDL_PLATFORM_GDK)) if (pfnBeginThread || pfnEndThread) { SDL_SetError("_beginthreadex/_endthreadex not supported on this platform"); return NULL; diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index 9d96012ff..ec6107bb2 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -38,8 +38,6 @@ #include "vita/SDL_systhread_c.h" #elif defined(SDL_THREAD_N3DS) #include "n3ds/SDL_systhread_c.h" -#elif defined(SDL_THREAD_STDCPP) -#include "stdcpp/SDL_systhread_c.h" #elif defined(SDL_THREAD_NGAGE) #include "ngage/SDL_systhread_c.h" #else diff --git a/src/thread/stdcpp/SDL_syscond.cpp b/src/thread/stdcpp/SDL_syscond.cpp deleted file mode 100644 index 592092e63..000000000 --- a/src/thread/stdcpp/SDL_syscond.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -extern "C" { -} - -#include -#include -#include -#include - -#include "SDL_sysmutex_c.h" - -struct SDL_Condition -{ - std::condition_variable_any cpp_cond; -}; - -// Create a condition variable -extern "C" -SDL_Condition *SDL_CreateCondition(void) -{ - // Allocate and initialize the condition variable - try { - SDL_Condition *cond = new SDL_Condition; - return cond; - } catch (std::system_error &ex) { - SDL_SetError("unable to create a C++ condition variable: code=%d; %s", ex.code(), ex.what()); - return NULL; - } catch (std::bad_alloc &) { - SDL_OutOfMemory(); - return NULL; - } -} - -// Destroy a condition variable -extern "C" -void SDL_DestroyCondition(SDL_Condition *cond) -{ - if (cond) { - delete cond; - } -} - -// Restart one of the threads that are waiting on the condition variable -extern "C" -void SDL_SignalCondition(SDL_Condition *cond) -{ - if (!cond) { - return; - } - - cond->cpp_cond.notify_one(); -} - -// Restart all threads that are waiting on the condition variable -extern "C" -void SDL_BroadcastCondition(SDL_Condition *cond) -{ - if (!cond) { - return; - } - - cond->cpp_cond.notify_all(); -} - -extern "C" -SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS) -{ - if (!cond || !mutex) { - return true; - } - - try { - std::unique_lock cpp_lock(mutex->cpp_mutex, std::adopt_lock_t()); - if (timeoutNS < 0) { - cond->cpp_cond.wait(cpp_lock); - cpp_lock.release(); - return true; - } else { - auto wait_result = cond->cpp_cond.wait_for( - cpp_lock, - std::chrono::duration(timeoutNS)); - cpp_lock.release(); - if (wait_result == std::cv_status::timeout) { - return false; - } else { - return true; - } - } - } catch (std::system_error &) { - return false; - } -} diff --git a/src/thread/stdcpp/SDL_sysmutex.cpp b/src/thread/stdcpp/SDL_sysmutex.cpp deleted file mode 100644 index 7a489b8f7..000000000 --- a/src/thread/stdcpp/SDL_sysmutex.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -extern "C" { -#include "SDL_systhread_c.h" -} - -#include - -#include "SDL_sysmutex_c.h" -#include - -extern "C" -SDL_Mutex * SDL_CreateMutex(void) -{ - // Allocate and initialize the mutex - try { - SDL_Mutex *mutex = new SDL_Mutex; - return mutex; - } catch (std::system_error &ex) { - SDL_SetError("unable to create a C++ mutex: code=%d; %s", ex.code(), ex.what()); - } catch (std::bad_alloc &) { - SDL_OutOfMemory(); - } - return NULL; -} - -extern "C" -void SDL_DestroyMutex(SDL_Mutex *mutex) -{ - if (mutex) { - delete mutex; - } -} - -extern "C" -void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doesn't know about NULL mutexes -{ - if (mutex) { - try { - mutex->cpp_mutex.lock(); - } catch (std::system_error &/*ex*/) { - SDL_assert(!"Error trying to lock mutex"); // assume we're in a lot of trouble if this assert fails. - } - } -} - -extern "C" -SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex) -{ - bool result = true; - if (mutex) { - result = mutex->cpp_mutex.try_lock(); - } - return result; -} - -// Unlock the mutex -extern "C" -void SDL_UnlockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doesn't know about NULL mutexes -{ - if (mutex) { - mutex->cpp_mutex.unlock(); - } -} - diff --git a/src/thread/stdcpp/SDL_sysmutex_c.h b/src/thread/stdcpp/SDL_sysmutex_c.h deleted file mode 100644 index c18f98740..000000000 --- a/src/thread/stdcpp/SDL_sysmutex_c.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include - -struct SDL_Mutex -{ - std::recursive_mutex cpp_mutex; -}; - diff --git a/src/thread/stdcpp/SDL_sysrwlock.cpp b/src/thread/stdcpp/SDL_sysrwlock.cpp deleted file mode 100644 index 1327a88b9..000000000 --- a/src/thread/stdcpp/SDL_sysrwlock.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#include -#include -#include - -struct SDL_RWLock -{ - std::shared_mutex cpp_mutex; - SDL_ThreadID write_owner; -}; - -extern "C" -SDL_RWLock *SDL_CreateRWLock(void) -{ - try { - SDL_RWLock *rwlock = new SDL_RWLock; - return rwlock; - } catch (std::system_error &ex) { - SDL_SetError("unable to create a C++ rwlock: code=%d; %s", ex.code(), ex.what()); - return NULL; - } catch (std::bad_alloc &) { - SDL_OutOfMemory(); - return NULL; - } -} - -extern "C" -void SDL_DestroyRWLock(SDL_RWLock *rwlock) -{ - if (rwlock) { - delete rwlock; - } -} - -extern "C" -void SDL_LockRWLockForReading(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doesn't know about NULL mutexes -{ - if (rwlock) { - try { - rwlock->cpp_mutex.lock_shared(); - } catch (std::system_error &/*ex*/) { - SDL_assert(!"Error trying to lock rwlock for reading"); // assume we're in a lot of trouble if this assert fails. - //return SDL_SetError("unable to lock a C++ rwlock: code=%d; %s", ex.code(), ex.what()); - } - } -} - -extern "C" -void SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doesn't know about NULL mutexes -{ - if (rwlock) { - try { - rwlock->cpp_mutex.lock(); - rwlock->write_owner = SDL_GetCurrentThreadID(); - } catch (std::system_error &/*ex*/) { - SDL_assert(!"Error trying to lock rwlock for writing"); // assume we're in a lot of trouble if this assert fails. - //return SDL_SetError("unable to lock a C++ rwlock: code=%d; %s", ex.code(), ex.what()); - } - } -} - -extern "C" -SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock) -{ - bool result = true; - if (rwlock) { - result = rwlock->cpp_mutex.try_lock_shared(); - } - return result; -} - -extern "C" -SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock) -{ - bool result = true; - if (rwlock) { - result = rwlock->cpp_mutex.try_lock(); - if (result) { - rwlock->write_owner = SDL_GetCurrentThreadID(); - } - } - return result; -} - -extern "C" -void SDL_UnlockRWLock(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doesn't know about NULL mutexes -{ - if (rwlock) { - if (rwlock->write_owner == SDL_GetCurrentThreadID()) { - rwlock->write_owner = 0; - rwlock->cpp_mutex.unlock(); - } else { - rwlock->cpp_mutex.unlock_shared(); - } - } -} - diff --git a/src/thread/stdcpp/SDL_systhread.cpp b/src/thread/stdcpp/SDL_systhread.cpp deleted file mode 100644 index c718d23dc..000000000 --- a/src/thread/stdcpp/SDL_systhread.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -// Thread management routines for SDL - -extern "C" { -#include "../SDL_thread_c.h" -#include "../SDL_systhread.h" -} - -#include -#include - -#ifdef SDL_PLATFORM_WINRT -#include -#endif - -static void RunThread(void *args) -{ - SDL_RunThread((SDL_Thread *)args); -} - -extern "C" -bool SDL_SYS_CreateThread(SDL_Thread *thread, - SDL_FunctionPointer pfnBeginThread, - SDL_FunctionPointer pfnEndThread) -{ - try { - // !!! FIXME: no way to set a thread stack size here. - thread->handle = (void *)new std::thread(RunThread, thread); - return true; - } catch (std::system_error &ex) { - return SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code().value(), ex.what()); - } catch (std::bad_alloc &) { - return SDL_OutOfMemory(); - } -} - -extern "C" -void SDL_SYS_SetupThread(const char *name) -{ - // Do nothing. -} - -extern "C" -SDL_ThreadID SDL_GetCurrentThreadID(void) -{ - static_assert(sizeof(std::thread::id) <= sizeof(SDL_ThreadID), "std::thread::id must not be bigger than SDL_ThreadID"); - SDL_ThreadID thread_id{}; - const auto cpp_thread_id = std::this_thread::get_id(); - SDL_memcpy(&thread_id, &cpp_thread_id, sizeof(std::thread::id)); - return thread_id; -} - -extern "C" -bool SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) -{ -#ifdef SDL_PLATFORM_WINRT - int value; - - if (priority == SDL_THREAD_PRIORITY_LOW) { - value = THREAD_PRIORITY_LOWEST; - } else if (priority == SDL_THREAD_PRIORITY_HIGH) { - value = THREAD_PRIORITY_HIGHEST; - } else if (priority == SDL_THREAD_PRIORITY_TIME_CRITICAL) { - // FIXME: WinRT does not support TIME_CRITICAL! -flibit - SDL_LogWarn(SDL_LOG_CATEGORY_SYSTEM, "TIME_CRITICAL unsupported, falling back to HIGHEST"); - value = THREAD_PRIORITY_HIGHEST; - } else { - value = THREAD_PRIORITY_NORMAL; - } - if (!SetThreadPriority(GetCurrentThread(), value)) { - return WIN_SetError("SetThreadPriority()"); - } - return true; -#else - return SDL_Unsupported(); -#endif -} - -extern "C" -void SDL_SYS_WaitThread(SDL_Thread *thread) -{ - if (!thread) { - return; - } - - try { - std::thread *cpp_thread = (std::thread *)thread->handle; - if (cpp_thread) { - if (cpp_thread->joinable()) { - cpp_thread->join(); - } - delete cpp_thread; - thread->handle = nullptr; - } - } catch (std::system_error &) { - // An error occurred when joining the thread. SDL_WaitThread does not, - // however, seem to provide a means to report errors to its callers - // though! - } -} - -extern "C" -void SDL_SYS_DetachThread(SDL_Thread *thread) -{ - if (!thread) { - return; - } - - try { - std::thread *cpp_thread = (std::thread *)thread->handle; - if (cpp_thread) { - if (cpp_thread->joinable()) { - cpp_thread->detach(); - } - delete cpp_thread; - thread->handle = nullptr; - } - } catch (std::system_error &) { - // An error occurred when detaching the thread. SDL_DetachThread does not, - // however, seem to provide a means to report errors to its callers - // though! - } -} - -static thread_local SDL_TLSData *thread_local_storage; - -extern "C" -void SDL_SYS_InitTLSData(void) -{ -} - -extern "C" -SDL_TLSData * SDL_SYS_GetTLSData(void) -{ - return thread_local_storage; -} - -extern "C" -bool SDL_SYS_SetTLSData(SDL_TLSData *data) -{ - thread_local_storage = data; - return true; -} - -extern "C" -void SDL_SYS_QuitTLSData(void) -{ -} diff --git a/src/thread/stdcpp/SDL_systhread_c.h b/src/thread/stdcpp/SDL_systhread_c.h deleted file mode 100644 index b8bf7b78a..000000000 --- a/src/thread/stdcpp/SDL_systhread_c.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -// For a thread handle, use a void pointer to a std::thread -typedef void *SYS_ThreadHandle; diff --git a/src/thread/windows/SDL_syscond_cv.c b/src/thread/windows/SDL_syscond_cv.c index 7cd444e8e..1291c7e30 100644 --- a/src/thread/windows/SDL_syscond_cv.c +++ b/src/thread/windows/SDL_syscond_cv.c @@ -56,12 +56,6 @@ typedef struct CONDITION_VARIABLE } CONDITION_VARIABLE, *PCONDITION_VARIABLE; #endif -#ifdef SDL_PLATFORM_WINRT -#define pWakeConditionVariable WakeConditionVariable -#define pWakeAllConditionVariable WakeAllConditionVariable -#define pSleepConditionVariableSRW SleepConditionVariableSRW -#define pSleepConditionVariableCS SleepConditionVariableCS -#else typedef VOID(WINAPI *pfnWakeConditionVariable)(PCONDITION_VARIABLE); typedef VOID(WINAPI *pfnWakeAllConditionVariable)(PCONDITION_VARIABLE); typedef BOOL(WINAPI *pfnSleepConditionVariableSRW)(PCONDITION_VARIABLE, PSRWLOCK, DWORD, ULONG); @@ -71,7 +65,6 @@ static pfnWakeConditionVariable pWakeConditionVariable = NULL; static pfnWakeAllConditionVariable pWakeAllConditionVariable = NULL; static pfnSleepConditionVariableSRW pSleepConditionVariableSRW = NULL; static pfnSleepConditionVariableCS pSleepConditionVariableCS = NULL; -#endif typedef struct SDL_cond_cv { @@ -152,7 +145,6 @@ static const SDL_cond_impl_t SDL_cond_impl_cv = { }; -#ifndef SDL_PLATFORM_WINRT // Generic Condition Variable implementation using SDL_Mutex and SDL_Semaphore static const SDL_cond_impl_t SDL_cond_impl_generic = { &SDL_CreateCondition_generic, @@ -161,7 +153,6 @@ static const SDL_cond_impl_t SDL_cond_impl_generic = { &SDL_BroadcastCondition_generic, &SDL_WaitConditionTimeoutNS_generic, }; -#endif SDL_Condition *SDL_CreateCondition(void) { @@ -179,10 +170,6 @@ SDL_Condition *SDL_CreateCondition(void) SDL_assert(SDL_mutex_impl_active.Type != SDL_MUTEX_INVALID); } -#ifdef SDL_PLATFORM_WINRT - // Link statically on this platform - impl = &SDL_cond_impl_cv; -#else // Default to generic implementation, works with all mutex implementations impl = &SDL_cond_impl_generic; { @@ -198,7 +185,6 @@ SDL_Condition *SDL_CreateCondition(void) } } } -#endif SDL_copyp(&SDL_cond_impl_active, impl); } diff --git a/src/thread/windows/SDL_sysmutex.c b/src/thread/windows/SDL_sysmutex.c index f1e173076..251f85cf6 100644 --- a/src/thread/windows/SDL_sysmutex.c +++ b/src/thread/windows/SDL_sysmutex.c @@ -39,13 +39,6 @@ SDL_mutex_impl_t SDL_mutex_impl_active = { 0 }; * Implementation based on Slim Reader/Writer (SRW) Locks for Win 7 and newer. */ -#ifdef SDL_PLATFORM_WINRT -// Functions are guaranteed to be available -#define pInitializeSRWLock InitializeSRWLock -#define pReleaseSRWLockExclusive ReleaseSRWLockExclusive -#define pAcquireSRWLockExclusive AcquireSRWLockExclusive -#define pTryAcquireSRWLockExclusive TryAcquireSRWLockExclusive -#else typedef VOID(WINAPI *pfnInitializeSRWLock)(PSRWLOCK); typedef VOID(WINAPI *pfnReleaseSRWLockExclusive)(PSRWLOCK); typedef VOID(WINAPI *pfnAcquireSRWLockExclusive)(PSRWLOCK); @@ -54,7 +47,6 @@ static pfnInitializeSRWLock pInitializeSRWLock = NULL; static pfnReleaseSRWLockExclusive pReleaseSRWLockExclusive = NULL; static pfnAcquireSRWLockExclusive pAcquireSRWLockExclusive = NULL; static pfnTryAcquireSRWLockExclusive pTryAcquireSRWLockExclusive = NULL; -#endif static SDL_Mutex *SDL_CreateMutex_srw(void) { @@ -143,12 +135,8 @@ static SDL_Mutex *SDL_CreateMutex_cs(void) if (mutex) { // Initialize // On SMP systems, a non-zero spin count generally helps performance -#ifdef SDL_PLATFORM_WINRT - InitializeCriticalSectionEx(&mutex->cs, 2000, 0); -#else // This function always succeeds (void)InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000); -#endif } return (SDL_Mutex *)mutex; } @@ -194,9 +182,6 @@ static const SDL_mutex_impl_t SDL_mutex_impl_cs = { SDL_Mutex *SDL_CreateMutex(void) { if (!SDL_mutex_impl_active.Create) { -#ifdef SDL_PLATFORM_WINRT - const SDL_mutex_impl_t *impl = &SDL_mutex_impl_srw; -#else const SDL_mutex_impl_t *impl = &SDL_mutex_impl_cs; // Try faster implementation for Windows 7 and newer @@ -212,7 +197,6 @@ SDL_Mutex *SDL_CreateMutex(void) impl = &SDL_mutex_impl_srw; } } -#endif // SDL_PLATFORM_WINRT // Copy instead of using pointer to save one level of indirection SDL_copyp(&SDL_mutex_impl_active, impl); diff --git a/src/thread/windows/SDL_sysrwlock_srw.c b/src/thread/windows/SDL_sysrwlock_srw.c index 8506d4cb0..10119520b 100644 --- a/src/thread/windows/SDL_sysrwlock_srw.c +++ b/src/thread/windows/SDL_sysrwlock_srw.c @@ -35,17 +35,6 @@ typedef VOID(WINAPI *pfnReleaseSRWLockExclusive)(PSRWLOCK); typedef VOID(WINAPI *pfnAcquireSRWLockExclusive)(PSRWLOCK); typedef BOOLEAN(WINAPI *pfnTryAcquireSRWLockExclusive)(PSRWLOCK); -#ifdef SDL_PLATFORM_WINRT -// Functions are guaranteed to be available -#define pTryAcquireSRWLockExclusive TryAcquireSRWLockExclusive -#define pInitializeSRWLock InitializeSRWLock -#define pReleaseSRWLockShared ReleaseSRWLockShared -#define pAcquireSRWLockShared AcquireSRWLockShared -#define pTryAcquireSRWLockShared TryAcquireSRWLockShared -#define pReleaseSRWLockExclusive ReleaseSRWLockExclusive -#define pAcquireSRWLockExclusive AcquireSRWLockExclusive -#define pTryAcquireSRWLockExclusive TryAcquireSRWLockExclusive -#else static pfnInitializeSRWLock pInitializeSRWLock = NULL; static pfnReleaseSRWLockShared pReleaseSRWLockShared = NULL; static pfnAcquireSRWLockShared pAcquireSRWLockShared = NULL; @@ -53,7 +42,6 @@ static pfnTryAcquireSRWLockShared pTryAcquireSRWLockShared = NULL; static pfnReleaseSRWLockExclusive pReleaseSRWLockExclusive = NULL; static pfnAcquireSRWLockExclusive pAcquireSRWLockExclusive = NULL; static pfnTryAcquireSRWLockExclusive pTryAcquireSRWLockExclusive = NULL; -#endif typedef SDL_RWLock *(*pfnSDL_CreateRWLock)(void); typedef void (*pfnSDL_DestroyRWLock)(SDL_RWLock *); @@ -152,7 +140,6 @@ static const SDL_rwlock_impl_t SDL_rwlock_impl_srw = { &SDL_UnlockRWLock_srw }; -#ifndef SDL_PLATFORM_WINRT #include "../generic/SDL_sysrwlock_c.h" @@ -166,19 +153,12 @@ static const SDL_rwlock_impl_t SDL_rwlock_impl_generic = { &SDL_TryLockRWLockForWriting_generic, &SDL_UnlockRWLock_generic }; -#endif SDL_RWLock *SDL_CreateRWLock(void) { if (!SDL_rwlock_impl_active.Create) { - const SDL_rwlock_impl_t *impl; - -#ifdef SDL_PLATFORM_WINRT - // Link statically on this platform - impl = &SDL_rwlock_impl_srw; -#else // Default to generic implementation, works with all mutex implementations - impl = &SDL_rwlock_impl_generic; + const SDL_rwlock_impl_t *impl = &SDL_rwlock_impl_generic; { HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); if (kernel32) { @@ -197,7 +177,6 @@ SDL_RWLock *SDL_CreateRWLock(void) } } } -#endif SDL_copyp(&SDL_rwlock_impl_active, impl); } diff --git a/src/thread/windows/SDL_syssem.c b/src/thread/windows/SDL_syssem.c index dcfd2c9f0..132e114ad 100644 --- a/src/thread/windows/SDL_syssem.c +++ b/src/thread/windows/SDL_syssem.c @@ -60,18 +60,11 @@ static SDL_sem_impl_t SDL_sem_impl_active = { 0 }; // APIs not available on WinPhone 8.1 // https://www.microsoft.com/en-us/download/details.aspx?id=47328 -#if !SDL_WINAPI_FAMILY_PHONE -#ifdef SDL_PLATFORM_WINRT -// Functions are guaranteed to be available -#define pWaitOnAddress WaitOnAddress -#define pWakeByAddressSingle WakeByAddressSingle -#else typedef BOOL(WINAPI *pfnWaitOnAddress)(volatile VOID *, PVOID, SIZE_T, DWORD); typedef VOID(WINAPI *pfnWakeByAddressSingle)(PVOID); static pfnWaitOnAddress pWaitOnAddress = NULL; static pfnWakeByAddressSingle pWakeByAddressSingle = NULL; -#endif typedef struct SDL_semaphore_atom { @@ -196,7 +189,6 @@ static const SDL_sem_impl_t SDL_sem_impl_atom = { &SDL_GetSemaphoreValue_atom, &SDL_SignalSemaphore_atom, }; -#endif // !SDL_WINAPI_FAMILY_PHONE /** * Fallback Semaphore implementation using Kernel Semaphores @@ -217,12 +209,7 @@ static SDL_Semaphore *SDL_CreateSemaphore_kern(Uint32 initial_value) sem = (SDL_sem_kern *)SDL_malloc(sizeof(*sem)); if (sem) { // Create the semaphore, with max value 32K -// !!! FIXME: CreateSemaphoreEx is available in Vista and later, so if XP support is dropped, we can lose this #ifdef. -#ifdef SDL_PLATFORM_WINRT - sem->id = CreateSemaphoreEx(NULL, initial_value, 32 * 1024, NULL, 0, SEMAPHORE_ALL_ACCESS); -#else sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL); -#endif sem->count = initial_value; if (!sem->id) { SDL_SetError("Couldn't create semaphore"); @@ -316,12 +303,7 @@ SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value) // Default to fallback implementation const SDL_sem_impl_t *impl = &SDL_sem_impl_kern; -#if !SDL_WINAPI_FAMILY_PHONE if (!SDL_GetHintBoolean(SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL, false)) { -#ifdef SDL_PLATFORM_WINRT - // Link statically on this platform - impl = &SDL_sem_impl_atom; -#else /* We already statically link to features from this Api * Set (e.g. WaitForSingleObject). Dynamically loading * API Sets is not explicitly documented but according to @@ -338,9 +320,7 @@ SDL_Semaphore *SDL_CreateSemaphore(Uint32 initial_value) impl = &SDL_sem_impl_atom; } } -#endif } -#endif // Copy instead of using pointer to save one level of indirection SDL_copyp(&SDL_sem_impl_active, impl); diff --git a/src/thread/windows/SDL_systhread.c b/src/thread/windows/SDL_systhread.c index 92cea5d78..aeda019ae 100644 --- a/src/thread/windows/SDL_systhread.c +++ b/src/thread/windows/SDL_systhread.c @@ -109,7 +109,6 @@ void SDL_SYS_SetupThread(const char *name) { if (name) { PVOID exceptionHandlerHandle; -#ifndef SDL_PLATFORM_WINRT // !!! FIXME: There's no LoadLibrary() in WinRT; don't know if SetThreadDescription is available there at all at the moment. static pfnSetThreadDescription pSetThreadDescription = NULL; static HMODULE kernel32 = NULL; @@ -133,7 +132,6 @@ void SDL_SYS_SetupThread(const char *name) SDL_free(strw); } } -#endif /* Presumably some version of Visual Studio will understand SetThreadDescription(), but we still need to deal with older OSes and debuggers. Set it with the arcane diff --git a/src/thread/windows/SDL_systls.c b/src/thread/windows/SDL_systls.c index 083008e52..1235a7ff4 100644 --- a/src/thread/windows/SDL_systls.c +++ b/src/thread/windows/SDL_systls.c @@ -27,18 +27,6 @@ #include "../SDL_thread_c.h" -#if WINAPI_FAMILY_WINRT -#include - -#ifndef TLS_OUT_OF_INDEXES -#define TLS_OUT_OF_INDEXES FLS_OUT_OF_INDEXES -#endif - -#define TlsAlloc() FlsAlloc(NULL) -#define TlsSetValue FlsSetValue -#define TlsGetValue FlsGetValue -#endif - static DWORD thread_local_storage = TLS_OUT_OF_INDEXES; static bool generic_local_storage = false; diff --git a/src/time/windows/SDL_systime.c b/src/time/windows/SDL_systime.c index 5dc6480fc..cf3389561 100644 --- a/src/time/windows/SDL_systime.c +++ b/src/time/windows/SDL_systime.c @@ -85,9 +85,6 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) SDL_zero(ft); -#ifdef SDL_PLATFORM_WINRT - GetSystemTimePreciseAsFileTime(&ft); -#else static pfnGetSystemTimePreciseAsFileTime pGetSystemTimePreciseAsFileTime = NULL; static bool load_attempted = false; @@ -105,7 +102,6 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks) } else { GetSystemTimeAsFileTime(&ft); } -#endif *ticks = SDL_TimeFromWindows(ft.dwLowDateTime, ft.dwHighDateTime); diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c index 3cd1da3aa..8c93a46f3 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -522,8 +522,7 @@ static Uint32 tick_denominator_ns; static Uint32 tick_numerator_ms; static Uint32 tick_denominator_ms; -#if defined(SDL_TIMER_WINDOWS) && \ - !defined(SDL_PLATFORM_WINRT) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) +#if defined(SDL_TIMER_WINDOWS) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) #include #define HAVE_TIME_BEGIN_PERIOD #endif diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index 568cf62fa..087c0f3db 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -66,18 +66,8 @@ Uint64 SDL_GetPerformanceFrequency(void) void SDL_SYS_DelayNS(Uint64 ns) { /* CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag was added in Windows 10 version 1803. - * - * Sleep() is not publicly available to apps in early versions of WinRT. - * - * Visual C++ 2013 Update 4 re-introduced Sleep() for Windows 8.1 and - * Windows Phone 8.1. * * Use the compiler version to determine availability. - * - * NOTE #1: _MSC_FULL_VER == 180030723 for Visual C++ 2013 Update 3. - * NOTE #2: Visual C++ 2013, when compiling for Windows 8.0 and - * Windows Phone 8.0, uses the Visual C++ 2012 compiler to build - * apps and libraries. */ #ifdef CREATE_WAITABLE_TIMER_HIGH_RESOLUTION HANDLE timer = SDL_GetWaitableTimer(); @@ -97,7 +87,7 @@ void SDL_SYS_DelayNS(Uint64 ns) ns = max_delay; } -#if defined(SDL_PLATFORM_WINRT) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER <= 180030723) +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER <= 180030723) static HANDLE mutex = 0; if (!mutex) { mutex = CreateEventEx(0, 0, 0, EVENT_ALL_ACCESS); diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c index 6d514fc55..53886b989 100644 --- a/src/video/SDL_egl.c +++ b/src/video/SDL_egl.c @@ -22,7 +22,7 @@ #ifdef SDL_VIDEO_OPENGL_EGL -#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) #include "../core/windows/SDL_windows.h" #endif #ifdef SDL_VIDEO_DRIVER_ANDROID @@ -74,7 +74,7 @@ #define DEFAULT_OGL_ES_PVR "libGLES_CM.so" #define DEFAULT_OGL_ES "libGLESv1_CM.so" -#elif defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) +#elif defined(SDL_VIDEO_DRIVER_WINDOWS) // EGL AND OpenGL ES support via ANGLE #define DEFAULT_EGL "libEGL.dll" #define DEFAULT_OGL "opengl32.dll" @@ -301,14 +301,14 @@ static bool SDL_EGL_LoadLibraryInternal(SDL_VideoDevice *_this, const char *egl_ { void *egl_dll_handle = NULL, *opengl_dll_handle = NULL; const char *path = NULL; -#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) const char *d3dcompiler; #endif #ifdef SDL_VIDEO_DRIVER_RPI bool vc4 = (0 == access("/sys/module/vc4/", F_OK)); #endif -#if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_WINRT) +#if defined(SDL_VIDEO_DRIVER_WINDOWS) d3dcompiler = SDL_GetHint(SDL_HINT_VIDEO_WIN_D3DCOMPILER); if (d3dcompiler) { if (SDL_strcasecmp(d3dcompiler, "none") != 0) { @@ -511,7 +511,6 @@ bool SDL_EGL_LoadLibrary(SDL_VideoDevice *_this, const char *egl_path, NativeDis _this->egl_data->egl_display = EGL_NO_DISPLAY; -#ifndef SDL_PLATFORM_WINRT #ifndef SDL_VIDEO_DRIVER_VITA if (platform) { /* EGL 1.5 allows querying for client version with EGL_NO_DISPLAY @@ -564,7 +563,6 @@ bool SDL_EGL_LoadLibrary(SDL_VideoDevice *_this, const char *egl_path, NativeDis *_this->gl_config.driver_path = '\0'; return SDL_SetError("Could not initialize EGL"); } -#endif // Get the EGL version with a valid egl_display, for EGL <= 1.4 SDL_EGL_GetVersion(_this); diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index d12818e4a..c9ac5c289 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -376,7 +376,7 @@ static bool scale_mat(const Uint32 *src, int src_w, int src_h, int src_pitch, Ui #define CAST_uint32x2_t (uint32x2_t) #endif -#if defined(SDL_PLATFORM_WINRT) || defined(_MSC_VER) +#if defined(_MSC_VER) #ifdef SDL_NEON_INTRINSICS #undef CAST_uint8x8_t #undef CAST_uint32x2_t diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 56d0d18ce..f740292f4 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -498,7 +498,6 @@ typedef struct VideoBootStrap extern VideoBootStrap COCOA_bootstrap; extern VideoBootStrap X11_bootstrap; extern VideoBootStrap WINDOWS_bootstrap; -extern VideoBootStrap WINRT_bootstrap; extern VideoBootStrap HAIKU_bootstrap; extern VideoBootStrap UIKIT_bootstrap; extern VideoBootStrap Android_bootstrap; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index b192e18e5..93719dd61 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -85,9 +85,6 @@ static VideoBootStrap *bootstrap[] = { #ifdef SDL_VIDEO_DRIVER_WINDOWS &WINDOWS_bootstrap, #endif -#ifdef SDL_VIDEO_DRIVER_WINRT - &WINRT_bootstrap, -#endif #ifdef SDL_VIDEO_DRIVER_HAIKU &HAIKU_bootstrap, #endif @@ -1750,10 +1747,6 @@ static void SDL_CheckWindowDisplayScaleChanged(SDL_Window *window) } } -#ifdef SDL_PLATFORM_WINRT -extern SDL_WindowFlags WINRT_DetectWindowFlags(SDL_Window *window); -#endif - static void SDL_RestoreMousePosition(SDL_Window *window) { float x, y; @@ -1851,35 +1844,6 @@ bool SDL_UpdateFullscreenMode(SDL_Window *window, SDL_FullscreenOp fullscreen, b } } } -#elif defined(SDL_PLATFORM_WINRT) && (NTDDI_VERSION < NTDDI_WIN10) - /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen - or not. The user can choose this, via OS-provided UI, but this can't - be set programmatically. - - Just look at what SDL's WinRT video backend code detected with regards - to fullscreen (being active, or not), and figure out a return/error code - from that. - */ - if (!!fullscreen == !(WINRT_DetectWindowFlags(window) & SDL_WINDOW_FULLSCREEN)) { - /* Uh oh, either: - 1. fullscreen was requested, and we're already windowed - 2. windowed-mode was requested, and we're already fullscreen - - WinRT 8.x can't resolve either programmatically, so we're - giving up. - */ - goto error; - } else { - /* Whatever was requested, fullscreen or windowed mode, is already - in-place. - */ - if (fullscreen) { - display->fullscreen_window = window; - } else { - display->fullscreen_window = NULL; - } - goto done; - } #endif if (display) { @@ -2453,17 +2417,6 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props) } #endif -#if defined(SDL_PLATFORM_WINRT) && (NTDDI_VERSION < NTDDI_WIN10) - /* HACK: WinRT 8.x apps can't choose whether or not they are fullscreen - or not. The user can choose this, via OS-provided UI, but this can't - be set programmatically. - - Just look at what SDL's WinRT video backend code detected with regards - to fullscreen (being active, or not), and figure out a return/error code - from that. - */ - flags = window->flags; -#endif if (title) { SDL_SetWindowTitle(window, title); } @@ -5426,9 +5379,6 @@ int SDL_GetMessageBoxCount(void) #ifdef SDL_VIDEO_DRIVER_WINDOWS #include "windows/SDL_windowsmessagebox.h" #endif -#ifdef SDL_VIDEO_DRIVER_WINRT -#include "winrt/SDL_winrtmessagebox.h" -#endif #ifdef SDL_VIDEO_DRIVER_COCOA #include "cocoa/SDL_cocoamessagebox.h" #endif diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 220304917..472c5bf29 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -396,14 +396,10 @@ static bool WIN_GetMonitorDESC1(HMONITOR hMonitor, DXGI_OUTPUT_DESC1 *desc) void *hDXGIMod = NULL; bool found = false; -#ifdef SDL_PLATFORM_WINRT - CreateDXGIFactoryFunc = CreateDXGIFactory1; -#else hDXGIMod = SDL_LoadObject("dxgi.dll"); if (hDXGIMod) { CreateDXGIFactoryFunc = (PFN_CREATE_DXGI_FACTORY)SDL_LoadFunction(hDXGIMod, "CreateDXGIFactory1"); } -#endif if (CreateDXGIFactoryFunc) { static const GUID SDL_IID_IDXGIFactory1 = { 0x770aae78, 0xf26f, 0x4dba, { 0xa8, 0x29, 0x25, 0x3c, 0x83, 0xd1, 0xb3, 0x87 } }; static const GUID SDL_IID_IDXGIOutput6 = { 0x068346e8, 0xaaec, 0x4b84, { 0xad, 0xd7, 0x13, 0x7f, 0x51, 0x3f, 0x77, 0xa1 } }; diff --git a/src/video/winrt/SDL_winrtevents.cpp b/src/video/winrt/SDL_winrtevents.cpp deleted file mode 100644 index 2543fb12b..000000000 --- a/src/video/winrt/SDL_winrtevents.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -/* - * Windows includes: - */ -#include -using namespace Windows::UI::Core; -using Windows::UI::Core::CoreCursor; - -/* - * SDL includes: - */ -#include "SDL_winrtevents_c.h" -#include "../../core/winrt/SDL_winrtapp_common.h" -#include "../../core/winrt/SDL_winrtapp_direct3d.h" -#include "../../core/winrt/SDL_winrtapp_xaml.h" - -extern "C" { -#include "../../thread/SDL_systhread.h" -#include "../SDL_sysvideo.h" -#include "../../events/SDL_events_c.h" -} - -// Forward declarations -static void WINRT_YieldXAMLThread(); - -// Global event management - -void WINRT_PumpEvents(SDL_VideoDevice *_this) -{ - if (SDL_WinRTGlobalApp) { - SDL_WinRTGlobalApp->PumpEvents(); - } else if (WINRT_XAMLWasEnabled) { - WINRT_YieldXAMLThread(); - } -} - -// XAML Thread management - -enum SDL_XAMLAppThreadState -{ - ThreadState_NotLaunched = 0, - ThreadState_Running, - ThreadState_Yielding -}; - -static SDL_XAMLAppThreadState _threadState = ThreadState_NotLaunched; -static SDL_Thread *_XAMLThread = nullptr; -static SDL_Mutex *_mutex = nullptr; -static SDL_Condition *_cond = nullptr; - -static void WINRT_YieldXAMLThread() -{ - SDL_LockMutex(_mutex); - SDL_assert(_threadState == ThreadState_Running); - _threadState = ThreadState_Yielding; - SDL_UnlockMutex(_mutex); - - SDL_SignalCondition(_cond); - - SDL_LockMutex(_mutex); - while (_threadState != ThreadState_Running) { - SDL_WaitCondition(_cond, _mutex); - } - SDL_UnlockMutex(_mutex); -} - -static int WINRT_XAMLThreadMain(void *userdata) -{ - // TODO, WinRT: pass the C-style main() a reasonably realistic - // representation of command line arguments. - int argc = 0; - char **argv = NULL; - return WINRT_SDLAppEntryPoint(argc, argv); -} - -void WINRT_CycleXAMLThread(void) -{ - switch (_threadState) { - case ThreadState_NotLaunched: - { - _cond = SDL_CreateCondition(); - - _mutex = SDL_CreateMutex(); - _threadState = ThreadState_Running; - _XAMLThread = SDL_CreateThread(WINRT_XAMLThreadMain, "SDL/XAML App Thread", nullptr); - - SDL_LockMutex(_mutex); - while (_threadState != ThreadState_Yielding) { - SDL_WaitCondition(_cond, _mutex); - } - SDL_UnlockMutex(_mutex); - - break; - } - - case ThreadState_Running: - { - SDL_assert(false); - break; - } - - case ThreadState_Yielding: - { - SDL_LockMutex(_mutex); - SDL_assert(_threadState == ThreadState_Yielding); - _threadState = ThreadState_Running; - SDL_UnlockMutex(_mutex); - - SDL_SignalCondition(_cond); - - SDL_LockMutex(_mutex); - while (_threadState != ThreadState_Yielding) { - SDL_WaitCondition(_cond, _mutex); - } - SDL_UnlockMutex(_mutex); - } - } -} - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtevents_c.h b/src/video/winrt/SDL_winrtevents_c.h deleted file mode 100644 index 2219190e8..000000000 --- a/src/video/winrt/SDL_winrtevents_c.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -extern "C" { -#include "../SDL_sysvideo.h" -} - -/* - * Internal-use, C-style functions: - */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void WINRT_InitTouch(SDL_VideoDevice *_this); -extern void WINRT_PumpEvents(SDL_VideoDevice *_this); - -#ifdef __cplusplus -} -#endif - -/* - * Internal-use, C++/CX functions: - */ -#ifdef __cplusplus_winrt - -// Pointers (Mice, Touch, etc.) -typedef enum -{ - NormalizeZeroToOne, - TransformToSDLWindowSize -} WINRT_CursorNormalizationType; -extern Windows::Foundation::Point WINRT_TransformCursorPosition(SDL_Window *window, - Windows::Foundation::Point rawPosition, - WINRT_CursorNormalizationType normalization); -extern bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed); -extern void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); -extern void WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); -extern void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); -extern void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); -extern void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); -extern void WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint); -extern void WINRT_ProcessMouseMovedEvent(SDL_Window *window, Windows::Devices::Input::MouseEventArgs ^ args); - -// Keyboard -extern void WINRT_ProcessAcceleratorKeyActivated(Windows::UI::Core::AcceleratorKeyEventArgs ^ args); -extern void WINRT_ProcessCharacterReceivedEvent(SDL_Window *window, Windows::UI::Core::CharacterReceivedEventArgs ^ args); - -#if NTDDI_VERSION >= NTDDI_WIN10 -extern void WINTRT_InitialiseInputPaneEvents(SDL_VideoDevice *_this); -extern bool WINRT_HasScreenKeyboardSupport(SDL_VideoDevice *_this); -extern void WINRT_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID props); -extern void WINRT_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); -extern bool WINRT_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); -#endif // NTDDI_VERSION >= ... - -// XAML Thread Management -extern void WINRT_CycleXAMLThread(void); - -#endif // ifdef __cplusplus_winrt diff --git a/src/video/winrt/SDL_winrtgamebar.cpp b/src/video/winrt/SDL_winrtgamebar.cpp deleted file mode 100644 index 2a6155e23..000000000 --- a/src/video/winrt/SDL_winrtgamebar.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -// Windows includes -#include -#include -#include - -// SDL includes -extern "C" { -#include "../SDL_sysvideo.h" -} -#include "SDL_winrtvideo_cpp.h" - -/* Game Bar events can come in off the main thread. Use the following - WinRT CoreDispatcher to deal with them on SDL's thread. -*/ -static Platform::WeakReference WINRT_MainThreadDispatcher; - -/* Win10's initial SDK (the 10.0.10240.0 release) does not include references - to Game Bar APIs, as the Game Bar was released via Win10 10.0.10586.0. - - Declare its WinRT/COM interface here, to allow compilation with earlier - Windows SDKs. -*/ -MIDL_INTERFACE("1DB9A292-CC78-4173-BE45-B61E67283EA7") -IGameBarStatics_ : public IInspectable -{ - public: - virtual HRESULT STDMETHODCALLTYPE add_VisibilityChanged( - __FIEventHandler_1_IInspectable * handler, - Windows::Foundation::EventRegistrationToken * token) = 0; - - virtual HRESULT STDMETHODCALLTYPE remove_VisibilityChanged( - Windows::Foundation::EventRegistrationToken token) = 0; - - virtual HRESULT STDMETHODCALLTYPE add_IsInputRedirectedChanged( - __FIEventHandler_1_IInspectable * handler, - Windows::Foundation::EventRegistrationToken * token) = 0; - - virtual HRESULT STDMETHODCALLTYPE remove_IsInputRedirectedChanged( - Windows::Foundation::EventRegistrationToken token) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_Visible( - boolean * value) = 0; - - virtual HRESULT STDMETHODCALLTYPE get_IsInputRedirected( - boolean * value) = 0; -}; - -// Declare the game bar's COM GUID -static GUID IID_IGameBarStatics_ = { MAKELONG(0xA292, 0x1DB9), 0xCC78, 0x4173, { 0xBE, 0x45, 0xB6, 0x1E, 0x67, 0x28, 0x3E, 0xA7 } }; - -/* Retrieves a pointer to the game bar, or NULL if it is not available. - If a pointer is returned, it's ->Release() method must be called - after the caller has finished using it. -*/ -static IGameBarStatics_ *WINRT_GetGameBar() -{ - const wchar_t *wClassName = L"Windows.Gaming.UI.GameBar"; - HSTRING hClassName; - IActivationFactory *pActivationFactory = NULL; - IGameBarStatics_ *pGameBar = NULL; - HRESULT hr; - - hr = ::WindowsCreateString(wClassName, (UINT32)SDL_wcslen(wClassName), &hClassName); - if (FAILED(hr)) { - goto done; - } - - hr = Windows::Foundation::GetActivationFactory(hClassName, &pActivationFactory); - if (FAILED(hr)) { - goto done; - } - - pActivationFactory->QueryInterface(IID_IGameBarStatics_, (void **)&pGameBar); - -done: - if (pActivationFactory) { - pActivationFactory->Release(); - } - if (hClassName) { - ::WindowsDeleteString(hClassName); - } - return pGameBar; -} - -static void WINRT_HandleGameBarIsInputRedirected_MainThread() -{ - IGameBarStatics_ *gameBar; - boolean isInputRedirected = 0; - if (!WINRT_MainThreadDispatcher) { - // The game bar event handler has been deregistered! - return; - } - gameBar = WINRT_GetGameBar(); - if (!gameBar) { - // Shouldn't happen, but just in case... - return; - } - if (SUCCEEDED(gameBar->get_IsInputRedirected(&isInputRedirected))) { - if (!isInputRedirected) { - /* Input-control is now back to the SDL app. Restore the cursor, - in case Windows does not (it does not in either Win10 - 10.0.10240.0 or 10.0.10586.0, maybe later version(s) too. - */ - SDL_Cursor *cursor = SDL_GetCursor(); - SDL_SetCursor(cursor); - } - } - gameBar->Release(); -} - -static void WINRT_HandleGameBarIsInputRedirected_NonMainThread(Platform::Object ^ o1, Platform::Object ^ o2) -{ - Windows::UI::Core::CoreDispatcher ^ dispatcher = WINRT_MainThreadDispatcher.Resolve(); - if (dispatcher) { - dispatcher->RunAsync( - Windows::UI::Core::CoreDispatcherPriority::Normal, - ref new Windows::UI::Core::DispatchedHandler(&WINRT_HandleGameBarIsInputRedirected_MainThread)); - } -} - -void WINRT_InitGameBar(SDL_VideoDevice *_this) -{ - SDL_VideoData *data = _this->internal; - IGameBarStatics_ *gameBar = WINRT_GetGameBar(); - if (gameBar) { - /* GameBar.IsInputRedirected events can come in via something other than - the main/SDL thread. - - Get a WinRT 'CoreDispatcher' that can be used to call back into the - SDL thread. - */ - WINRT_MainThreadDispatcher = Windows::UI::Core::CoreWindow::GetForCurrentThread()->Dispatcher; - Windows::Foundation::EventHandler ^ handler = - ref new Windows::Foundation::EventHandler(&WINRT_HandleGameBarIsInputRedirected_NonMainThread); - __FIEventHandler_1_IInspectable *pHandler = reinterpret_cast<__FIEventHandler_1_IInspectable *>(handler); - gameBar->add_IsInputRedirectedChanged(pHandler, &data->gameBarIsInputRedirectedToken); - gameBar->Release(); - } -} - -void WINRT_QuitGameBar(SDL_VideoDevice *_this) -{ - SDL_VideoData *data; - IGameBarStatics_ *gameBar; - if (!_this || !_this->internal) { - return; - } - gameBar = WINRT_GetGameBar(); - if (!gameBar) { - return; - } - data = _this->internal; - if (data->gameBarIsInputRedirectedToken.Value) { - gameBar->remove_IsInputRedirectedChanged(data->gameBarIsInputRedirectedToken); - data->gameBarIsInputRedirectedToken.Value = 0; - } - WINRT_MainThreadDispatcher = nullptr; - gameBar->Release(); -} - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtgamebar_cpp.h b/src/video/winrt/SDL_winrtgamebar_cpp.h deleted file mode 100644 index 3a3026464..000000000 --- a/src/video/winrt/SDL_winrtgamebar_cpp.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifndef SDL_winrtgamebar_h_ -#define SDL_winrtgamebar_h_ - -#ifdef __cplusplus -/* These are exported as C++ functions, rather than C, to fix a compilation - bug with MSVC 2013, for Windows 8.x builds. */ -extern void WINRT_InitGameBar(SDL_VideoDevice *_this); -extern void WINRT_QuitGameBar(SDL_VideoDevice *_this); -#endif - -#endif // SDL_winrtgamebar_h_ diff --git a/src/video/winrt/SDL_winrtkeyboard.cpp b/src/video/winrt/SDL_winrtkeyboard.cpp deleted file mode 100644 index 2caff1cf3..000000000 --- a/src/video/winrt/SDL_winrtkeyboard.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -// Windows-specific includes -#include -#include - -// SDL-specific includes -#include "SDL_winrtevents_c.h" - -extern "C" { -#include "../../events/scancodes_windows.h" -#include "../../events/SDL_keyboard_c.h" -} - -#include "SDL_winrtvideo_cpp.h" - -static SDL_Scancode WINRT_TranslateKeycode(Windows::System::VirtualKey virtualKey, const Windows::UI::Core::CorePhysicalKeyStatus& keyStatus, Uint16 *rawcode) -{ - SDL_Scancode code; - Uint8 index; - Uint16 scanCode = keyStatus.ScanCode | (keyStatus.IsExtendedKey ? 0xe000 : 0); - - /* Pause/Break key have a special scan code with 0xe1 prefix - * that is not properly reported under UWP. - * Use Pause scan code that is used in Win32. */ - if (virtualKey == Windows::System::VirtualKey::Pause) { - scanCode = 0xe046; - } - - // Pack scan code into one byte to make the index. - index = LOBYTE(scanCode) | (HIBYTE(scanCode) ? 0x80 : 0x00); - code = windows_scancode_table[index]; - *rawcode = scanCode; - - return code; -} - -void WINRT_ProcessAcceleratorKeyActivated(Windows::UI::Core::AcceleratorKeyEventArgs ^ args) -{ - using namespace Windows::UI::Core; - - Uint8 state; - SDL_Scancode code; - Uint16 rawcode = 0; - - switch (args->EventType) { - case CoreAcceleratorKeyEventType::SystemKeyDown: - case CoreAcceleratorKeyEventType::KeyDown: - state = SDL_PRESSED; - break; - case CoreAcceleratorKeyEventType::SystemKeyUp: - case CoreAcceleratorKeyEventType::KeyUp: - state = SDL_RELEASED; - break; - default: - return; - } - - code = WINRT_TranslateKeycode(args->VirtualKey, args->KeyStatus, &rawcode); - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, rawcode, code, state); -} - -void WINRT_ProcessCharacterReceivedEvent(SDL_Window *window, Windows::UI::Core::CharacterReceivedEventArgs ^ args) -{ - if (!window) { - return; - } - - SDL_WindowData *data = window->internal; - - if (SDL_TextInputActive(window)) { - /* Characters outside Unicode Basic Multilingual Plane (BMP) - * are coded as so called "surrogate pair" in two separate UTF-16 character events. - * Cache high surrogate until next character event. */ - if (IS_HIGH_SURROGATE(args->KeyCode)) { - data->high_surrogate = (WCHAR)args->KeyCode; - } else { - WCHAR utf16[] = { - data->high_surrogate ? data->high_surrogate : (WCHAR)args->KeyCode, - data->high_surrogate ? (WCHAR)args->KeyCode : L'\0', - L'\0' - }; - - char utf8[5]; - // doesn't need to be WIN_WideCharToMultiByte, since we don't care about WinXP support in WinRT. - int result = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, utf16, -1, utf8, sizeof(utf8), NULL, NULL); - if (result > 0) { - SDL_SendKeyboardText(utf8); - } - - data->high_surrogate = L'\0'; - } - } else { - data->high_surrogate = L'\0'; - } -} - -#if NTDDI_VERSION >= NTDDI_WIN10 - -static bool WINRT_InputPaneVisible = false; - -void WINTRT_OnInputPaneShowing(Windows::UI::ViewManagement::InputPane ^ sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs ^ args) -{ - WINRT_InputPaneVisible = true; -} - -void WINTRT_OnInputPaneHiding(Windows::UI::ViewManagement::InputPane ^ sender, Windows::UI::ViewManagement::InputPaneVisibilityEventArgs ^ args) -{ - WINRT_InputPaneVisible = false; -} - -void WINTRT_InitialiseInputPaneEvents(SDL_VideoDevice *_this) -{ - using namespace Windows::UI::ViewManagement; - InputPane ^ inputPane = InputPane::GetForCurrentView(); - if (inputPane) { - inputPane->Showing += ref new Windows::Foundation::TypedEventHandler(&WINTRT_OnInputPaneShowing); - inputPane->Hiding += ref new Windows::Foundation::TypedEventHandler(&WINTRT_OnInputPaneHiding); - } -} - -bool WINRT_HasScreenKeyboardSupport(SDL_VideoDevice *_this) -{ - return true; -} - -void WINRT_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID props) -{ - using namespace Windows::UI::ViewManagement; - InputPane ^ inputPane = InputPane::GetForCurrentView(); - if (inputPane) { - inputPane->TryShow(); - } -} - -void WINRT_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) -{ - using namespace Windows::UI::ViewManagement; - InputPane ^ inputPane = InputPane::GetForCurrentView(); - if (inputPane) { - inputPane->TryHide(); - } -} - -bool WINRT_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) -{ - using namespace Windows::UI::ViewManagement; - InputPane ^ inputPane = InputPane::GetForCurrentView(); - if (inputPane) { - switch (SDL_GetWinRTDeviceFamily()) { - case SDL_WINRT_DEVICEFAMILY_XBOX: - // Documentation recommends using inputPane->Visible - // https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.inputpane.visible?view=winrt-22621 - // This does not seem to work on latest UWP/Xbox. - // Workaround: Listen to Showing/Hiding events - if (WINRT_InputPaneVisible) { - return true; - } - break; - default: - // OccludedRect is recommend on universal apps per docs - // https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.inputpane.visible?view=winrt-22621 - Windows::Foundation::Rect rect = inputPane->OccludedRect; - if (rect.Width > 0 && rect.Height > 0) { - return true; - } - break; - } - } - return false; -} - -#endif // NTDDI_VERSION >= ... - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtmessagebox.cpp b/src/video/winrt/SDL_winrtmessagebox.cpp deleted file mode 100644 index 59c025c45..000000000 --- a/src/video/winrt/SDL_winrtmessagebox.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -extern "C" { -#include "../../core/windows/SDL_windows.h" -} - -#include "SDL_winrtevents_c.h" - -#include -using namespace Platform; -using namespace Windows::Foundation; -using namespace Windows::UI::Popups; - -static String ^ WINRT_UTF8ToPlatformString(const char *str) { - wchar_t *wstr = WIN_UTF8ToStringW(str); - String ^ rtstr = ref new String(wstr); - SDL_free(wstr); - return rtstr; -} - -extern "C" -bool WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID) -{ -#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. - * - * The .NET runtime on Windows Phone 8 does, however, include a - * MessageBox class. Perhaps this could be called, somehow? - */ - return SDL_SetError("SDL_messagebox support is not available for Windows Phone 8.0"); -#else - SDL_VideoDevice *_this = SDL_GetVideoDevice(); - -#if SDL_WINAPI_FAMILY_PHONE - const int maxbuttons = 2; - const char *platform = "Windows Phone 8.1+"; -#else - const int maxbuttons = 3; - const char *platform = "Windows 8.x"; -#endif - - if (messageboxdata->numbuttons > maxbuttons) { - return SDL_SetError("WinRT's MessageDialog only supports %d buttons, at most, on %s. %d were requested.", - maxbuttons, platform, messageboxdata->numbuttons); - } - - // Build a MessageDialog object and its buttons - MessageDialog ^ dialog = ref new MessageDialog(WINRT_UTF8ToPlatformString(messageboxdata->message)); - dialog->Title = WINRT_UTF8ToPlatformString(messageboxdata->title); - for (int i = 0; i < messageboxdata->numbuttons; ++i) { - const SDL_MessageBoxButtonData *sdlButton; - if (messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT) { - sdlButton = &messageboxdata->buttons[messageboxdata->numbuttons - 1 - i]; - } else { - sdlButton = &messageboxdata->buttons[i]; - } - UICommand ^ button = ref new UICommand(WINRT_UTF8ToPlatformString(sdlButton->text)); - button->Id = IntPtr((int)((size_t)(sdlButton - messageboxdata->buttons))); - dialog->Commands->Append(button); - if (sdlButton->flags & SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT) { - dialog->CancelCommandIndex = i; - } - if (sdlButton->flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) { - dialog->DefaultCommandIndex = i; - } - } - - // Display the MessageDialog, then wait for it to be closed - // TODO, WinRT: Find a way to redraw MessageDialog instances if a GPU device-reset occurs during the following event-loop - auto operation = dialog->ShowAsync(); - while (operation->Status == Windows::Foundation::AsyncStatus::Started) { - WINRT_PumpEvents(_this); - } - - // Retrieve results from the MessageDialog and process them accordingly - if (operation->Status != Windows::Foundation::AsyncStatus::Completed) { - return SDL_SetError("An unknown error occurred in displaying the WinRT MessageDialog"); - } - if (buttonID) { - IntPtr results = safe_cast(operation->GetResults()->Id); - int clicked_index = results.ToInt32(); - *buttonID = messageboxdata->buttons[clicked_index].buttonID; - } - return true; -#endif // if SDL_WINAPI_FAMILY_PHONE / else -} - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtmessagebox.h b/src/video/winrt/SDL_winrtmessagebox.h deleted file mode 100644 index c34707f47..000000000 --- a/src/video/winrt/SDL_winrtmessagebox.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -extern bool WINRT_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID); - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtmouse.cpp b/src/video/winrt/SDL_winrtmouse.cpp deleted file mode 100644 index a6e5adda4..000000000 --- a/src/video/winrt/SDL_winrtmouse.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -/* - * Windows includes: - */ -#include -#include -using namespace Windows::UI::Core; -using Windows::UI::Core::CoreCursor; - -/* - * SDL includes: - */ -extern "C" { -#include "../../events/SDL_mouse_c.h" -#include "../../events/SDL_touch_c.h" -#include "../SDL_sysvideo.h" -} - -#include "../../core/winrt/SDL_winrtapp_direct3d.h" -#include "SDL_winrtvideo_cpp.h" -#include "SDL_winrtmouse_c.h" - -extern "C" bool WINRT_UsingRelativeMouseMode = false; - -static SDL_Cursor *WINRT_CreateSystemCursor(SDL_SystemCursor id) -{ - SDL_Cursor *cursor; - CoreCursorType cursorType = CoreCursorType::Arrow; - - switch (id) { - default: - SDL_assert(0); - return NULL; - case SDL_SYSTEM_CURSOR_DEFAULT: - cursorType = CoreCursorType::Arrow; - break; - case SDL_SYSTEM_CURSOR_TEXT: - cursorType = CoreCursorType::IBeam; - break; - case SDL_SYSTEM_CURSOR_WAIT: - cursorType = CoreCursorType::Wait; - break; - case SDL_SYSTEM_CURSOR_CROSSHAIR: - cursorType = CoreCursorType::Cross; - break; - case SDL_SYSTEM_CURSOR_PROGRESS: - cursorType = CoreCursorType::Wait; - break; - case SDL_SYSTEM_CURSOR_NWSE_RESIZE: - cursorType = CoreCursorType::SizeNorthwestSoutheast; - break; - case SDL_SYSTEM_CURSOR_NESW_RESIZE: - cursorType = CoreCursorType::SizeNortheastSouthwest; - break; - case SDL_SYSTEM_CURSOR_EW_RESIZE: - cursorType = CoreCursorType::SizeWestEast; - break; - case SDL_SYSTEM_CURSOR_NS_RESIZE: - cursorType = CoreCursorType::SizeNorthSouth; - break; - case SDL_SYSTEM_CURSOR_MOVE: - cursorType = CoreCursorType::SizeAll; - break; - case SDL_SYSTEM_CURSOR_NOT_ALLOWED: - cursorType = CoreCursorType::UniversalNo; - break; - case SDL_SYSTEM_CURSOR_POINTER: - cursorType = CoreCursorType::Hand; - break; - case SDL_SYSTEM_CURSOR_NW_RESIZE: - cursorType = CoreCursorType::SizeNorthwestSoutheast; - break; - case SDL_SYSTEM_CURSOR_N_RESIZE: - cursorType = CoreCursorType::SizeNorthSouth; - break; - case SDL_SYSTEM_CURSOR_NE_RESIZE: - cursorType = CoreCursorType::SizeNortheastSouthwest; - break; - case SDL_SYSTEM_CURSOR_E_RESIZE: - cursorType = CoreCursorType::SizeWestEast; - break; - case SDL_SYSTEM_CURSOR_SE_RESIZE: - cursorType = CoreCursorType::SizeNorthwestSoutheast; - break; - case SDL_SYSTEM_CURSOR_S_RESIZE: - cursorType = CoreCursorType::SizeNorthSouth; - break; - case SDL_SYSTEM_CURSOR_SW_RESIZE: - cursorType = CoreCursorType::SizeNortheastSouthwest; - break; - case SDL_SYSTEM_CURSOR_W_RESIZE: - cursorType = CoreCursorType::SizeWestEast; - break; - } - - cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); - if (cursor) { - /* Create a pointer to a COM reference to a cursor. The extra - pointer is used (on top of the COM reference) to allow the cursor - to be referenced by the SDL_cursor's internal field, which is - a void pointer. - */ - CoreCursor ^ *theCursor = new CoreCursor ^ (nullptr); - *theCursor = ref new CoreCursor(cursorType, 0); - cursor->internal = (SDL_CursorData *)theCursor; - } - - return cursor; -} - -static SDL_Cursor *WINRT_CreateDefaultCursor() -{ - return WINRT_CreateSystemCursor(SDL_SYSTEM_CURSOR_DEFAULT); -} - -static void WINRT_FreeCursor(SDL_Cursor *cursor) -{ - if (cursor->internal) { - CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->internal; - *theCursor = nullptr; // Release the COM reference to the CoreCursor - delete theCursor; // Delete the pointer to the COM reference - } - SDL_free(cursor); -} - -static bool WINRT_ShowCursor(SDL_Cursor *cursor) -{ - // TODO, WinRT, XAML: make WINRT_ShowCursor work when XAML support is enabled. - if (!CoreWindow::GetForCurrentThread()) { - return true; - } - - CoreWindow ^ coreWindow = CoreWindow::GetForCurrentThread(); - if (cursor) { - CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->internal; - coreWindow->PointerCursor = *theCursor; - } else { - // HACK ALERT: TL;DR - Hiding the cursor in WinRT/UWP apps is weird, and - // a Win32-style cursor resource file must be directly included in apps, - // otherwise hiding the cursor will cause mouse-motion data to never be - // received. - // - // Here's the lengthy explanation: - // - // There are two ways to hide a cursor in WinRT/UWP apps. - // Both involve setting the WinRT CoreWindow's (which is somewhat analogous - // to a Win32 HWND) 'PointerCursor' property. - // - // The first way to hide a cursor sets PointerCursor to nullptr. This - // is, arguably, the easiest to implement for an app. It does have an - // unfortunate side-effect: it'll prevent mouse-motion events from being - // sent to the app (via CoreWindow). - // - // The second way to hide a cursor sets PointerCursor to a transparent - // cursor. This allows mouse-motion events to be sent to the app, but is - // more difficult to set up, as: - // 1. WinRT/UWP, while providing a few stock cursors, does not provide - // a completely transparent cursor. - // 2. WinRT/UWP allows apps to provide custom-built cursors, but *ONLY* - // if they are linked directly inside the app, via Win32-style - // cursor resource files. APIs to create cursors at runtime are - // not provided to apps, and attempting to link-to or use Win32 - // cursor-creation APIs could cause an app to fail Windows Store - // certification. - // - // SDL can use either means of hiding the cursor. It provides a Win32-style - // set of cursor resource files in its source distribution, inside - // src/main/winrt/. If those files are linked to an SDL-for-WinRT/UWP app - // (by including them in a MSVC project, for example), SDL will attempt to - // use those, if and when the cursor is hidden via SDL APIs. If those - // files are not linked in, SDL will attempt to hide the cursor via the - // 'set PointerCursor to nullptr' means (which, if you recall, causes - // mouse-motion data to NOT be sent to the app!). - // - // Tech notes: - // - SDL's blank cursor resource uses a resource ID of 5000. - // - SDL's cursor resources consist of the following two files: - // - src/main/winrt/SDL3-WinRTResource_BlankCursor.cur -- cursor pixel data - // - src/main/winrt/SDL3-WinRTResources.rc -- declares the cursor resource, and its ID (of 5000) - // - - const unsigned int win32CursorResourceID = 5000; - CoreCursor ^ blankCursor = ref new CoreCursor(CoreCursorType::Custom, win32CursorResourceID); - - // Set 'PointerCursor' to 'blankCursor' in a way that shouldn't throw - // an exception if the app hasn't loaded that resource. - ABI::Windows::UI::Core::ICoreCursor *iblankCursor = reinterpret_cast(blankCursor); - ABI::Windows::UI::Core::ICoreWindow *icoreWindow = reinterpret_cast(coreWindow); - HRESULT hr = icoreWindow->put_PointerCursor(iblankCursor); - if (FAILED(hr)) { - // The app doesn't contain the cursor resource, or some other error - // occurred. Just use the other, but mouse-motion-preventing, means of - // hiding the cursor. - coreWindow->PointerCursor = nullptr; - } - } - return true; -} - -static bool WINRT_SetRelativeMouseMode(bool enabled) -{ - WINRT_UsingRelativeMouseMode = enabled; - return true; -} - -void WINRT_InitMouse(SDL_VideoDevice *_this) -{ - SDL_Mouse *mouse = SDL_GetMouse(); - - /* DLudwig, Dec 3, 2012: WinRT does not currently provide APIs for - the following features, AFAIK: - - custom cursors (multiple system cursors are, however, available) - - programmatically moveable cursors - */ - -#if !SDL_WINAPI_FAMILY_PHONE - // mouse->CreateCursor = WINRT_CreateCursor; - mouse->CreateSystemCursor = WINRT_CreateSystemCursor; - mouse->ShowCursor = WINRT_ShowCursor; - mouse->FreeCursor = WINRT_FreeCursor; - // mouse->WarpMouse = WINRT_WarpMouse; - mouse->SetRelativeMouseMode = WINRT_SetRelativeMouseMode; - - SDL_SetDefaultCursor(WINRT_CreateDefaultCursor()); -#endif -} - -void WINRT_QuitMouse(SDL_VideoDevice *_this) -{ -} - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtmouse_c.h b/src/video/winrt/SDL_winrtmouse_c.h deleted file mode 100644 index bf41245b3..000000000 --- a/src/video/winrt/SDL_winrtmouse_c.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifndef SDL_winrtmouse_h_ -#define SDL_winrtmouse_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void WINRT_InitMouse(SDL_VideoDevice *_this); -extern void WINRT_QuitMouse(SDL_VideoDevice *_this); -extern bool WINRT_UsingRelativeMouseMode; - -#ifdef __cplusplus -} -#endif - -#endif // SDL_winrtmouse_h_ diff --git a/src/video/winrt/SDL_winrtopengles.cpp b/src/video/winrt/SDL_winrtopengles.cpp deleted file mode 100644 index 442014c9b..000000000 --- a/src/video/winrt/SDL_winrtopengles.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#if defined(SDL_VIDEO_DRIVER_WINRT) && defined(SDL_VIDEO_OPENGL_EGL) - -// EGL implementation of SDL OpenGL support - -#include "SDL_winrtvideo_cpp.h" -extern "C" { -#include "SDL_winrtopengles.h" -#include "../SDL_egl_c.h" -} - -// Windows includes -#include -using namespace Windows::UI::Core; - -// ANGLE/WinRT constants -static const int ANGLE_D3D_FEATURE_LEVEL_ANY = 0; -#define EGL_PLATFORM_ANGLE_ANGLE 0x3202 -#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203 -#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204 -#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205 -#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208 -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE 0x320B -#define EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE 0x320F - -#define EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER 0x320B - -/* - * SDL/EGL top-level implementation - */ - -extern "C" -bool WINRT_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) -{ - SDL_VideoData *video_data = _this->internal; - - if (!SDL_EGL_LoadLibrary(_this, path, EGL_DEFAULT_DISPLAY, 0)) { - return false; - } - - // Load ANGLE/WinRT-specific functions - CreateWinrtEglWindow_Old_Function CreateWinrtEglWindow = (CreateWinrtEglWindow_Old_Function)SDL_LoadFunction(_this->egl_data->opengl_dll_handle, "CreateWinrtEglWindow"); - if (CreateWinrtEglWindow) { - /* 'CreateWinrtEglWindow' was found, which means that an an older - * version of ANGLE/WinRT is being used. Continue setting up EGL, - * as appropriate to this version of ANGLE. - */ - - // Create an ANGLE/WinRT EGL-window - // TODO, WinRT: check for XAML usage before accessing the CoreWindow, as not doing so could lead to a crash - CoreWindow ^ native_win = CoreWindow::GetForCurrentThread(); - Microsoft::WRL::ComPtr cpp_win = reinterpret_cast(native_win); - HRESULT result = CreateWinrtEglWindow(cpp_win, ANGLE_D3D_FEATURE_LEVEL_ANY, &(video_data->winrtEglWindow)); - if (FAILED(result)) { - return false; - } - - /* Call eglGetDisplay and eglInitialize as appropriate. On other - * platforms, this would probably get done by SDL_EGL_LoadLibrary, - * however ANGLE/WinRT's current implementation (as of Mar 22, 2014) of - * eglGetDisplay requires that a C++ object be passed into it, so the - * call will be made in this file, a C++ file, instead. - */ - Microsoft::WRL::ComPtr cpp_display = video_data->winrtEglWindow; - _this->egl_data->egl_display = ((eglGetDisplay_Old_Function)_this->egl_data->eglGetDisplay)(cpp_display); - if (!_this->egl_data->egl_display) { - return SDL_EGL_SetError("Could not get Windows 8.0 EGL display", "eglGetDisplay"); - } - - if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { - return SDL_EGL_SetError("Could not initialize Windows 8.0 EGL", "eglInitialize"); - } - } else { - /* Declare some ANGLE/EGL initialization property-sets, as suggested by - * MSOpenTech's ANGLE-for-WinRT template apps: - */ - const EGLint defaultDisplayAttributes[] = { - EGL_PLATFORM_ANGLE_TYPE_ANGLE, - EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, - EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, - EGL_TRUE, - EGL_NONE, - }; - - const EGLint fl9_3DisplayAttributes[] = { - EGL_PLATFORM_ANGLE_TYPE_ANGLE, - EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, - 9, - EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, - 3, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, - EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, - EGL_TRUE, - EGL_NONE, - }; - - const EGLint warpDisplayAttributes[] = { - EGL_PLATFORM_ANGLE_TYPE_ANGLE, - EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, - EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, - EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, - EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER, - EGL_TRUE, - EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE, - EGL_TRUE, - EGL_NONE, - }; - - /* 'CreateWinrtEglWindow' was NOT found, which either means that a - * newer version of ANGLE/WinRT is being used, or that we don't have - * a valid copy of ANGLE. - * - * Try loading ANGLE as if it were the newer version. - */ - eglGetPlatformDisplayEXT_Function eglGetPlatformDisplayEXT = (eglGetPlatformDisplayEXT_Function)_this->egl_data->eglGetProcAddress("eglGetPlatformDisplayEXT"); - if (!eglGetPlatformDisplayEXT) { - return SDL_EGL_SetError("Could not retrieve ANGLE/WinRT display function(s)", "eglGetProcAddress"); - } - -#if !SDL_WINAPI_FAMILY_PHONE - /* Try initializing EGL at D3D11 Feature Level 10_0+ (which is not - * supported on WinPhone 8.x. - */ - _this->egl_data->egl_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, defaultDisplayAttributes); - if (!_this->egl_data->egl_display) { - return SDL_EGL_SetError("Could not get EGL display for Direct3D 10_0+", "eglGetPlatformDisplayEXT"); - } - - if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) -#endif - { - /* Try initializing EGL at D3D11 Feature Level 9_3, in case the - * 10_0 init fails, or we're on Windows Phone (which only supports - * 9_3). - */ - _this->egl_data->egl_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, fl9_3DisplayAttributes); - if (!_this->egl_data->egl_display) { - return SDL_EGL_SetError("Could not get EGL display for Direct3D 9_3", "eglGetPlatformDisplayEXT"); - } - - if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { - /* Try initializing EGL at D3D11 Feature Level 11_0 on WARP - * (a Windows-provided, software rasterizer) if all else fails. - */ - _this->egl_data->egl_display = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, warpDisplayAttributes); - if (!_this->egl_data->egl_display) { - return SDL_EGL_SetError("Could not get EGL display for Direct3D WARP", "eglGetPlatformDisplayEXT"); - } - - if (_this->egl_data->eglInitialize(_this->egl_data->egl_display, NULL, NULL) != EGL_TRUE) { - return SDL_EGL_SetError("Could not initialize WinRT 8.x+ EGL", "eglInitialize"); - } - } - } - } - - return true; -} - -extern "C" -void WINRT_GLES_UnloadLibrary(SDL_VideoDevice *_this) -{ - SDL_VideoData *video_data = _this->internal; - - // Release SDL's own COM reference to the ANGLE/WinRT IWinrtEglWindow - if (video_data->winrtEglWindow) { - video_data->winrtEglWindow->Release(); - video_data->winrtEglWindow = nullptr; - } - - // Perform the bulk of the unloading - SDL_EGL_UnloadLibrary(_this); -} - -extern "C" { -SDL_EGL_CreateContext_impl(WINRT) -SDL_EGL_SwapWindow_impl(WINRT) -SDL_EGL_MakeCurrent_impl(WINRT) -} - -#endif // SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL diff --git a/src/video/winrt/SDL_winrtopengles.h b/src/video/winrt/SDL_winrtopengles.h deleted file mode 100644 index 33fb8c49a..000000000 --- a/src/video/winrt/SDL_winrtopengles.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifndef SDL_winrtopengles_h_ -#define SDL_winrtopengles_h_ - -#if defined(SDL_VIDEO_DRIVER_WINRT) && defined(SDL_VIDEO_OPENGL_EGL) - -#include "../SDL_sysvideo.h" -#include "../SDL_egl_c.h" - -// OpenGLES functions -#define WINRT_GLES_GetAttribute SDL_EGL_GetAttribute -#define WINRT_GLES_GetProcAddress SDL_EGL_GetProcAddressInternal -#define WINRT_GLES_SetSwapInterval SDL_EGL_SetSwapInterval -#define WINRT_GLES_GetSwapInterval SDL_EGL_GetSwapInterval -#define WINRT_GLES_DestroyContext SDL_EGL_DestroyContext - -extern bool WINRT_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path); -extern void WINRT_GLES_UnloadLibrary(SDL_VideoDevice *_this); -extern SDL_GLContext WINRT_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window); -extern bool WINRT_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window); -extern bool WINRT_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context); - -#ifdef __cplusplus - -/* Typedefs for ANGLE/WinRT's C++-based native-display and native-window types, - * which are used when calling eglGetDisplay and eglCreateWindowSurface. - */ -typedef Microsoft::WRL::ComPtr WINRT_EGLNativeWindowType_Old; - -/* Function pointer typedefs for 'old' ANGLE/WinRT's functions, which may - * require that C++ objects be passed in: - */ -typedef EGLDisplay(EGLAPIENTRY *eglGetDisplay_Old_Function)(WINRT_EGLNativeWindowType_Old); -typedef EGLSurface(EGLAPIENTRY *eglCreateWindowSurface_Old_Function)(EGLDisplay, EGLConfig, WINRT_EGLNativeWindowType_Old, const EGLint *); -typedef HRESULT(EGLAPIENTRY *CreateWinrtEglWindow_Old_Function)(Microsoft::WRL::ComPtr, int, IUnknown **result); - -#endif // __cplusplus - -/* Function pointer typedefs for 'new' ANGLE/WinRT functions, which, unlike - * the old functions, do not require C++ support and work with plain C. - */ -typedef EGLDisplay(EGLAPIENTRY *eglGetPlatformDisplayEXT_Function)(EGLenum, void *, const EGLint *); - -#endif // SDL_VIDEO_DRIVER_WINRT && SDL_VIDEO_OPENGL_EGL - -#endif // SDL_winrtopengles_h_ diff --git a/src/video/winrt/SDL_winrtpointerinput.cpp b/src/video/winrt/SDL_winrtpointerinput.cpp deleted file mode 100644 index efd5b0fc1..000000000 --- a/src/video/winrt/SDL_winrtpointerinput.cpp +++ /dev/null @@ -1,389 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -// SDL includes -#include "SDL_winrtevents_c.h" -#include "SDL_winrtmouse_c.h" -#include "SDL_winrtvideo_cpp.h" - -extern "C" { -#include "../SDL_sysvideo.h" -#include "../../events/SDL_events_c.h" -#include "../../events/SDL_mouse_c.h" -#include "../../events/SDL_touch_c.h" -} - -// File-specific globals: -static SDL_TouchID WINRT_TouchID = 1; - -void WINRT_InitTouch(SDL_VideoDevice *_this) -{ - SDL_AddTouch(WINRT_TouchID, SDL_TOUCH_DEVICE_DIRECT, ""); -} - -// -// Applies necessary geometric transformations to raw cursor positions: -// -Windows::Foundation::Point -WINRT_TransformCursorPosition(SDL_Window *window, - Windows::Foundation::Point rawPosition, - WINRT_CursorNormalizationType normalization) -{ - using namespace Windows::UI::Core; - using namespace Windows::Graphics::Display; - - if (!window) { - return rawPosition; - } - - SDL_WindowData *windowData = window->internal; - if (windowData->coreWindow == nullptr) { - // For some reason, the window isn't associated with a CoreWindow. - // This might end up being the case as XAML support is extended. - // For now, if there's no CoreWindow attached to the SDL_Window, - // don't do any transforms. - - // TODO, WinRT: make sure touch input coordinate ranges are correct when using XAML support - return rawPosition; - } - - // The CoreWindow can only be accessed on certain thread(s). - SDL_assert(CoreWindow::GetForCurrentThread() != nullptr); - - CoreWindow ^ nativeWindow = windowData->coreWindow.Get(); - Windows::Foundation::Point outputPosition; - - // Compute coordinates normalized from 0..1. - // If the coordinates need to be sized to the SDL window, - // we'll do that after. -#if !SDL_WINAPI_FAMILY_PHONE || NTDDI_VERSION > NTDDI_WIN8 - outputPosition.X = rawPosition.X / nativeWindow->Bounds.Width; - outputPosition.Y = rawPosition.Y / nativeWindow->Bounds.Height; -#else - switch (WINRT_DISPLAY_PROPERTY(CurrentOrientation)) { - case DisplayOrientations::Portrait: - outputPosition.X = rawPosition.X / nativeWindow->Bounds.Width; - outputPosition.Y = rawPosition.Y / nativeWindow->Bounds.Height; - break; - case DisplayOrientations::PortraitFlipped: - outputPosition.X = 1.0f - (rawPosition.X / nativeWindow->Bounds.Width); - outputPosition.Y = 1.0f - (rawPosition.Y / nativeWindow->Bounds.Height); - break; - case DisplayOrientations::Landscape: - outputPosition.X = rawPosition.Y / nativeWindow->Bounds.Height; - outputPosition.Y = 1.0f - (rawPosition.X / nativeWindow->Bounds.Width); - break; - case DisplayOrientations::LandscapeFlipped: - outputPosition.X = 1.0f - (rawPosition.Y / nativeWindow->Bounds.Height); - outputPosition.Y = rawPosition.X / nativeWindow->Bounds.Width; - break; - default: - break; - } -#endif - - if (normalization == TransformToSDLWindowSize) { - outputPosition.X *= ((float32)window->w); - outputPosition.Y *= ((float32)window->h); - } - - return outputPosition; -} - -bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed) -{ - using namespace Windows::UI::Input; - -#if SDL_WINAPI_FAMILY_PHONE - *button = SDL_BUTTON_LEFT; - return true; -#else - switch (pt->Properties->PointerUpdateKind) { - case PointerUpdateKind::LeftButtonPressed: - case PointerUpdateKind::LeftButtonReleased: - *button = SDL_BUTTON_LEFT; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::LeftButtonPressed); - return true; - - case PointerUpdateKind::RightButtonPressed: - case PointerUpdateKind::RightButtonReleased: - *button = SDL_BUTTON_RIGHT; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::RightButtonPressed); - return true; - - case PointerUpdateKind::MiddleButtonPressed: - case PointerUpdateKind::MiddleButtonReleased: - *button = SDL_BUTTON_MIDDLE; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::MiddleButtonPressed); - return true; - - case PointerUpdateKind::XButton1Pressed: - case PointerUpdateKind::XButton1Released: - *button = SDL_BUTTON_X1; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::XButton1Pressed); - return true; - - case PointerUpdateKind::XButton2Pressed: - case PointerUpdateKind::XButton2Released: - *button = SDL_BUTTON_X2; - *pressed = (pt->Properties->PointerUpdateKind == PointerUpdateKind::XButton2Pressed); - return true; - - default: - break; - } -#endif - - *button = 0; - *pressed = 0; - return false; -} - -// const char * -// WINRT_ConvertPointerUpdateKindToString(Windows::UI::Input::PointerUpdateKind kind) -//{ -// using namespace Windows::UI::Input; -// -// switch (kind) -// { -// case PointerUpdateKind::Other: -// return "Other"; -// case PointerUpdateKind::LeftButtonPressed: -// return "LeftButtonPressed"; -// case PointerUpdateKind::LeftButtonReleased: -// return "LeftButtonReleased"; -// case PointerUpdateKind::RightButtonPressed: -// return "RightButtonPressed"; -// case PointerUpdateKind::RightButtonReleased: -// return "RightButtonReleased"; -// case PointerUpdateKind::MiddleButtonPressed: -// return "MiddleButtonPressed"; -// case PointerUpdateKind::MiddleButtonReleased: -// return "MiddleButtonReleased"; -// case PointerUpdateKind::XButton1Pressed: -// return "XButton1Pressed"; -// case PointerUpdateKind::XButton1Released: -// return "XButton1Released"; -// case PointerUpdateKind::XButton2Pressed: -// return "XButton2Pressed"; -// case PointerUpdateKind::XButton2Released: -// return "XButton2Released"; -// } -// -// return ""; -// } - -static bool WINRT_IsTouchEvent(Windows::UI::Input::PointerPoint ^ pointerPoint) -{ -#if SDL_WINAPI_FAMILY_PHONE - return true; -#else - using namespace Windows::Devices::Input; - switch (pointerPoint->PointerDevice->PointerDeviceType) { - case PointerDeviceType::Touch: - case PointerDeviceType::Pen: - return true; - default: - return false; - } -#endif -} - -void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) -{ - if (!window) { - return; - } - - if (!WINRT_IsTouchEvent(pointerPoint)) { - Uint8 button, pressed; - WINRT_GetSDLButtonForPointerPoint(pointerPoint, &button, &pressed); - SDL_assert(pressed == 1); - SDL_SendMouseButton(0, window, SDL_DEFAULT_MOUSE_ID, SDL_PRESSED, button); - } else { - Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne); - Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize); - - SDL_SendTouch(0, - WINRT_TouchID, - (SDL_FingerID)(pointerPoint->PointerId + 1), - window, - true, - normalizedPoint.X, - normalizedPoint.Y, - pointerPoint->Properties->Pressure); - } -} - -void WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) -{ - if (!window || WINRT_UsingRelativeMouseMode) { - return; - } - - Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne); - Windows::Foundation::Point windowPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, TransformToSDLWindowSize); - - if (!WINRT_IsTouchEvent(pointerPoint)) { - // For some odd reason Moved events are used for multiple mouse buttons - Uint8 button, pressed; - if (WINRT_GetSDLButtonForPointerPoint(pointerPoint, &button, &pressed)) { - SDL_SendMouseButton(0, window, SDL_DEFAULT_MOUSE_ID, pressed, button); - } - - SDL_SendMouseMotion(0, window, SDL_DEFAULT_MOUSE_ID, false, windowPoint.X, windowPoint.Y); - } else { - SDL_SendTouchMotion(0, - WINRT_TouchID, - (SDL_FingerID)(pointerPoint->PointerId + 1), - window, - normalizedPoint.X, - normalizedPoint.Y, - pointerPoint->Properties->Pressure); - } -} - -void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) -{ - if (!window) { - return; - } - - if (!WINRT_IsTouchEvent(pointerPoint)) { - Uint8 button, pressed; - WINRT_GetSDLButtonForPointerPoint(pointerPoint, &button, &pressed); - SDL_assert(pressed == 0); - SDL_SendMouseButton(0, window, SDL_DEFAULT_MOUSE_ID, SDL_RELEASED, button); - } else { - Windows::Foundation::Point normalizedPoint = WINRT_TransformCursorPosition(window, pointerPoint->Position, NormalizeZeroToOne); - - SDL_SendTouch(0, - WINRT_TouchID, - (SDL_FingerID)(pointerPoint->PointerId + 1), - window, - false, - normalizedPoint.X, - normalizedPoint.Y, - pointerPoint->Properties->Pressure); - } -} - -void WINRT_ProcessPointerEnteredEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) -{ - if (!window) { - return; - } - - if (!WINRT_IsTouchEvent(pointerPoint)) { - SDL_SetMouseFocus(window); - } -} - -void WINRT_ProcessPointerExitedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) -{ - if (!window) { - return; - } - - if (!WINRT_IsTouchEvent(pointerPoint)) { - SDL_SetMouseFocus(NULL); - } -} - -void WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Input::PointerPoint ^ pointerPoint) -{ - if (!window) { - return; - } - - float motion = (float)pointerPoint->Properties->MouseWheelDelta / WHEEL_DELTA; - SDL_SendMouseWheel(0, window, SDL_DEFAULT_MOUSE_ID, 0.0f, motion, SDL_MOUSEWHEEL_NORMAL); -} - -void WINRT_ProcessMouseMovedEvent(SDL_Window *window, Windows::Devices::Input::MouseEventArgs ^ args) -{ - if (!window || !WINRT_UsingRelativeMouseMode) { - return; - } - - // DLudwig, 2012-12-28: On some systems, namely Visual Studio's Windows - // Simulator, as well as Windows 8 in a Parallels 8 VM, MouseEventArgs' - // MouseDelta field often reports very large values. More information - // on this can be found at the following pages on MSDN: - // - http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/a3c789fa-f1c5-49c4-9c0a-7db88d0f90f8 - // - https://connect.microsoft.com/VisualStudio/Feedback/details/756515 - // - // The values do not appear to be as large when running on some systems, - // most notably a Surface RT. Furthermore, the values returned by - // CoreWindow's PointerMoved event, and sent to this class' OnPointerMoved - // method, do not ever appear to be large, even when MouseEventArgs' - // MouseDelta is reporting to the contrary. - // - // On systems with the large-values behavior, it appears that the values - // get reported as if the screen's size is 65536 units in both the X and Y - // dimensions. This can be viewed by using Windows' now-private, "Raw Input" - // APIs. (GetRawInputData, RegisterRawInputDevices, WM_INPUT, etc.) - // - // MSDN's documentation on MouseEventArgs' MouseDelta field (at - // http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.input.mouseeventargs.mousedelta ), - // does not seem to indicate (to me) that its values should be so large. It - // says that its values should be a "change in screen location". I could - // be misinterpreting this, however a post on MSDN from a Microsoft engineer (see: - // http://social.msdn.microsoft.com/Forums/en-US/winappswithnativecode/thread/09a9868e-95bb-4858-ba1a-cb4d2c298d62 ), - // indicates that these values are in DIPs, which is the same unit used - // by CoreWindow's PointerMoved events (via the Position field in its CurrentPoint - // property. See http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.input.pointerpoint.position.aspx - // for details.) - // - // To note, PointerMoved events are sent a 'RawPosition' value (via the - // CurrentPoint property in MouseEventArgs), however these do not seem - // to exhibit the same large-value behavior. - // - // The values passed via PointerMoved events can't always be used for relative - // mouse motion, unfortunately. Its values are bound to the cursor's position, - // which stops when it hits one of the screen's edges. This can be a problem in - // first person shooters, whereby it is normal for mouse motion to travel far - // along any one axis for a period of time. MouseMoved events do not have the - // screen-bounding limitation, and can be used regardless of where the system's - // cursor is. - // - // One possible workaround would be to programmatically set the cursor's - // position to the screen's center (when SDL's relative mouse mode is enabled), - // however WinRT does not yet seem to have the ability to set the cursor's - // position via a public API. Win32 did this via an API call, SetCursorPos, - // however WinRT makes this function be private. Apps that use it won't get - // approved for distribution in the Windows Store. I've yet to be able to find - // a suitable, store-friendly counterpart for WinRT. - // - // There may be some room for a workaround whereby OnPointerMoved's values - // are compared to the values from OnMouseMoved in order to detect - // when this bug is active. A suitable transformation could then be made to - // OnMouseMoved's values. - // - const Windows::Foundation::Point mouseDeltaInDIPs((float)args->MouseDelta.X, (float)args->MouseDelta.Y); - const Windows::Foundation::Point mouseDeltaInSDLWindowCoords = WINRT_TransformCursorPosition(window, mouseDeltaInDIPs, TransformToSDLWindowSize); - SDL_SendMouseMotion(0, window, SDL_DEFAULT_MOUSE_ID, true, mouseDeltaInSDLWindowCoords.X, mouseDeltaInSDLWindowCoords.Y); -} - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp deleted file mode 100644 index 7b551c76c..000000000 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ /dev/null @@ -1,846 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ -#include "SDL_internal.h" - -#ifdef SDL_VIDEO_DRIVER_WINRT - -/* WinRT SDL video driver implementation - - Initial work on this was done by David Ludwig (dludwig@pobox.com), and - was based off of SDL's "dummy" video driver. - */ - -// Standard C++11 includes -#include -#include - -// Windows includes -#include -#include -#include -#include -#include -using namespace Windows::ApplicationModel::Core; -using namespace Windows::Foundation; -using namespace Windows::Graphics::Display; -using namespace Windows::UI::Core; -using namespace Windows::UI::ViewManagement; - -// [re]declare Windows GUIDs locally, to limit the amount of external lib(s) SDL has to link to -static const GUID SDL_IID_IDisplayRequest = { 0xe5732044, 0xf49f, 0x4b60, { 0x8d, 0xd4, 0x5e, 0x7e, 0x3a, 0x63, 0x2a, 0xc0 } }; -static const GUID SDL_IID_IDXGIFactory2 = { 0x50c83a1c, 0xe072, 0x4c48, { 0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0 } }; - -// SDL includes -extern "C" { -#include "../../core/windows/SDL_windows.h" -#include "../../events/SDL_events_c.h" -#include "../../render/SDL_sysrender.h" -#include "../SDL_pixels_c.h" -#include "../SDL_sysvideo.h" -#include "SDL_winrtopengles.h" -#include "SDL_winrtmessagebox.h" -} - -#include "../../core/winrt/SDL_winrtapp_direct3d.h" -#include "../../core/winrt/SDL_winrtapp_xaml.h" -#include "SDL_winrtevents_c.h" -#include "SDL_winrtgamebar_cpp.h" -#include "SDL_winrtmouse_c.h" -#include "SDL_winrtvideo_cpp.h" - -// Initialization/Query functions -static bool WINRT_VideoInit(SDL_VideoDevice *_this); -static bool WINRT_InitModes(SDL_VideoDevice *_this); -static bool WINRT_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); -static void WINRT_VideoQuit(SDL_VideoDevice *_this); - -// Window functions -static bool WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props); -static void WINRT_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); -static SDL_FullscreenResult WINRT_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen); -static void WINRT_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window); - -// Misc functions -static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(SDL_VideoDevice *_this); -extern bool WINRT_SuspendScreenSaver(SDL_VideoDevice *_this); - -// SDL-internal globals: -SDL_Window *WINRT_GlobalSDLWindow = NULL; - -// WinRT driver bootstrap functions - -static void WINRT_DeleteDevice(SDL_VideoDevice *device) -{ - if (device->internal) { - SDL_VideoData *video_data = device->internal; - if (video_data->winrtEglWindow) { - video_data->winrtEglWindow->Release(); - } - SDL_free(video_data); - } - - SDL_free(device); -} - -static SDL_VideoDevice *WINRT_CreateDevice(void) -{ - SDL_VideoDevice *device; - SDL_VideoData *data; - - // Initialize all variables that we clean on shutdown - device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); - if (!device) { - return NULL; - } - - data = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); - if (!data) { - SDL_free(device); - return NULL; - } - device->internal = data; - - // Set the function pointers - device->VideoInit = WINRT_VideoInit; - device->VideoQuit = WINRT_VideoQuit; - device->CreateSDLWindow = WINRT_CreateWindow; - device->SetWindowSize = WINRT_SetWindowSize; - device->SetWindowFullscreen = WINRT_SetWindowFullscreen; - device->DestroyWindow = WINRT_DestroyWindow; - device->SetDisplayMode = WINRT_SetDisplayMode; - device->PumpEvents = WINRT_PumpEvents; - device->SuspendScreenSaver = WINRT_SuspendScreenSaver; - -#if NTDDI_VERSION >= NTDDI_WIN10 - device->HasScreenKeyboardSupport = WINRT_HasScreenKeyboardSupport; - device->ShowScreenKeyboard = WINRT_ShowScreenKeyboard; - device->HideScreenKeyboard = WINRT_HideScreenKeyboard; - device->IsScreenKeyboardShown = WINRT_IsScreenKeyboardShown; - - WINTRT_InitialiseInputPaneEvents(device); -#endif - -#ifdef SDL_VIDEO_OPENGL_EGL - device->GL_LoadLibrary = WINRT_GLES_LoadLibrary; - device->GL_GetProcAddress = WINRT_GLES_GetProcAddress; - device->GL_UnloadLibrary = WINRT_GLES_UnloadLibrary; - device->GL_CreateContext = WINRT_GLES_CreateContext; - device->GL_MakeCurrent = WINRT_GLES_MakeCurrent; - device->GL_SetSwapInterval = WINRT_GLES_SetSwapInterval; - device->GL_GetSwapInterval = WINRT_GLES_GetSwapInterval; - device->GL_SwapWindow = WINRT_GLES_SwapWindow; - device->GL_DestroyContext = WINRT_GLES_DestroyContext; -#endif - device->free = WINRT_DeleteDevice; - - return device; -} - -VideoBootStrap WINRT_bootstrap = { - "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) -{ - SDL_assert(SDL_strcmp(name, SDL_HINT_ORIENTATIONS) == 0); - - /* HACK: prevent SDL from altering an app's .appxmanifest-set orientation - * from being changed on startup, by detecting when SDL_HINT_ORIENTATIONS - * is getting registered. - * - * TODO, WinRT: consider reading in an app's .appxmanifest file, and apply its orientation when 'newValue == NULL'. - */ - if ((!oldValue) && (!newValue)) { - return; - } - - // Start with no orientation flags, then add each in as they're parsed - // from newValue. - unsigned int orientationFlags = 0; - if (newValue) { - std::istringstream tokenizer(newValue); - while (!tokenizer.eof()) { - std::string orientationName; - std::getline(tokenizer, orientationName, ' '); - if (orientationName == "LandscapeLeft") { - orientationFlags |= (unsigned int)DisplayOrientations::LandscapeFlipped; - } else if (orientationName == "LandscapeRight") { - orientationFlags |= (unsigned int)DisplayOrientations::Landscape; - } else if (orientationName == "Portrait") { - orientationFlags |= (unsigned int)DisplayOrientations::Portrait; - } else if (orientationName == "PortraitUpsideDown") { - orientationFlags |= (unsigned int)DisplayOrientations::PortraitFlipped; - } - } - } - - // If no valid orientation flags were specified, use a reasonable set of defaults: - if (!orientationFlags) { - // TODO, WinRT: consider seeing if an app's default orientation flags can be found out via some API call(s). - orientationFlags = (unsigned int)(DisplayOrientations::Landscape | - DisplayOrientations::LandscapeFlipped | - DisplayOrientations::Portrait | - DisplayOrientations::PortraitFlipped); - } - - // Set the orientation/rotation preferences. Please note that this does - // not constitute a 100%-certain lock of a given set of possible - // orientations. According to Microsoft's documentation on WinRT [1] - // when a device is not capable of being rotated, Windows may ignore - // the orientation preferences, and stick to what the device is capable of - // displaying. - // - // [1] Documentation on the 'InitialRotationPreference' setting for a - // Windows app's manifest file describes how some orientation/rotation - // preferences may be ignored. See - // http://msdn.microsoft.com/en-us/library/windows/apps/hh700343.aspx - // for details. Microsoft's "Display orientation sample" also gives an - // outline of how Windows treats device rotation - // (http://code.msdn.microsoft.com/Display-Orientation-Sample-19a58e93). - WINRT_DISPLAY_PROPERTY(AutoRotationPreferences) = (DisplayOrientations)orientationFlags; -} - -bool WINRT_VideoInit(SDL_VideoDevice *_this) -{ - SDL_VideoData *internal = _this->internal; - if (!WINRT_InitModes(_this)) { - return false; - } - - // Register the hint, SDL_HINT_ORIENTATIONS, with SDL. - // TODO, WinRT: see if an app's default orientation can be found out via WinRT API(s), then set the initial value of SDL_HINT_ORIENTATIONS accordingly. - SDL_AddHintCallback(SDL_HINT_ORIENTATIONS, WINRT_SetDisplayOrientationsPreference, NULL); - - WINRT_InitMouse(_this); - WINRT_InitTouch(_this); - WINRT_InitGameBar(_this); - if (internal) { - // Initialize screensaver-disabling support - internal->displayRequest = WINRT_CreateDisplayRequest(_this); - } - - // Assume we have a mouse and keyboard - SDL_AddKeyboard(SDL_DEFAULT_KEYBOARD_ID, NULL, false); - SDL_AddMouse(SDL_DEFAULT_MOUSE_ID, NULL, false); - - return true; -} - -extern "C" SDL_PixelFormat D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat); - -static void WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC *dxgiMode, SDL_DisplayMode *sdlMode) -{ - SDL_zerop(sdlMode); - sdlMode->w = dxgiMode->Width; - sdlMode->h = dxgiMode->Height; - sdlMode->refresh_rate_numerator = dxgiMode->RefreshRate.Numerator; - sdlMode->refresh_rate_denominator = dxgiMode->RefreshRate.Denominator; - sdlMode->format = D3D11_DXGIFormatToSDLPixelFormat(dxgiMode->Format); -} - -static bool WINRT_AddDisplaysForOutput(SDL_VideoDevice *_this, IDXGIAdapter1 *dxgiAdapter1, int outputIndex) -{ - HRESULT hr; - IDXGIOutput *dxgiOutput = NULL; - DXGI_OUTPUT_DESC dxgiOutputDesc; - SDL_VideoDisplay display; - UINT numModes; - DXGI_MODE_DESC *dxgiModes = NULL; - bool result = false; - DXGI_MODE_DESC modeToMatch, closestMatch; - - SDL_zero(display); - - hr = dxgiAdapter1->EnumOutputs(outputIndex, &dxgiOutput); - if (FAILED(hr)) { - if (hr != DXGI_ERROR_NOT_FOUND) { - WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIAdapter1::EnumOutputs failed", hr); - } - goto done; - } - - hr = dxgiOutput->GetDesc(&dxgiOutputDesc); - if (FAILED(hr)) { - WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::GetDesc failed", hr); - goto done; - } - - SDL_zero(modeToMatch); - modeToMatch.Format = DXGI_FORMAT_B8G8R8A8_UNORM; - modeToMatch.Width = (dxgiOutputDesc.DesktopCoordinates.right - dxgiOutputDesc.DesktopCoordinates.left); - modeToMatch.Height = (dxgiOutputDesc.DesktopCoordinates.bottom - dxgiOutputDesc.DesktopCoordinates.top); - hr = dxgiOutput->FindClosestMatchingMode(&modeToMatch, &closestMatch, NULL); - if (hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { - /* DXGI_ERROR_NOT_CURRENTLY_AVAILABLE gets returned by IDXGIOutput::FindClosestMatchingMode - when running under the Windows Simulator, which uses Remote Desktop (formerly known as Terminal - Services) under the hood. According to the MSDN docs for the similar function, - IDXGIOutput::GetDisplayModeList, DXGI_ERROR_NOT_CURRENTLY_AVAILABLE is returned if and - when an app is run under a Terminal Services session, hence the assumption. - - In this case, just add an SDL display mode, with approximated values. - */ - SDL_DisplayMode mode; - SDL_zero(mode); - display.name = SDL_strdup("Windows Simulator / Terminal Services Display"); - mode.w = (dxgiOutputDesc.DesktopCoordinates.right - dxgiOutputDesc.DesktopCoordinates.left); - mode.h = (dxgiOutputDesc.DesktopCoordinates.bottom - dxgiOutputDesc.DesktopCoordinates.top); - mode.format = D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM); - display.desktop_mode = mode; - } else if (FAILED(hr)) { - WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::FindClosestMatchingMode failed", hr); - goto done; - } else { - display.name = WIN_StringToUTF8W(dxgiOutputDesc.DeviceName); - WINRT_DXGIModeToSDLDisplayMode(&closestMatch, &display.desktop_mode); - - hr = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, NULL); - if (FAILED(hr)) { - WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::GetDisplayModeList [get mode list size] failed", hr); - goto done; - } - - dxgiModes = (DXGI_MODE_DESC *)SDL_calloc(numModes, sizeof(DXGI_MODE_DESC)); - if (!dxgiModes) { - goto done; - } - - hr = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, dxgiModes); - if (FAILED(hr)) { - WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::GetDisplayModeList [get mode contents] failed", hr); - goto done; - } - - for (UINT i = 0; i < numModes; ++i) { - SDL_DisplayMode sdlMode; - WINRT_DXGIModeToSDLDisplayMode(&dxgiModes[i], &sdlMode); - SDL_AddFullscreenDisplayMode(&display, &sdlMode); - } - } - - if (SDL_AddVideoDisplay(&display, false) == 0) { - goto done; - } - - result = true; - -done: - if (dxgiModes) { - SDL_free(dxgiModes); - } - if (dxgiOutput) { - dxgiOutput->Release(); - } - if (display.name) { - SDL_free(display.name); - } - return result; -} - -static bool WINRT_AddDisplaysForAdapter(SDL_VideoDevice *_this, IDXGIFactory2 *dxgiFactory2, int adapterIndex) -{ - HRESULT hr; - IDXGIAdapter1 *dxgiAdapter1; - - hr = dxgiFactory2->EnumAdapters1(adapterIndex, &dxgiAdapter1); - if (FAILED(hr)) { - if (hr != DXGI_ERROR_NOT_FOUND) { - WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIFactory1::EnumAdapters1() failed", hr); - } - return false; - } - - for (int outputIndex = 0;; ++outputIndex) { - if (!WINRT_AddDisplaysForOutput(_this, dxgiAdapter1, outputIndex)) { - /* HACK: The Windows App Certification Kit 10.0 can fail, when - running the Store Apps' test, "Direct3D Feature Test". The - certification kit's error is: - - "Application App was not running at the end of the test. It likely crashed or was terminated for having become unresponsive." - - This was caused by SDL/WinRT's DXGI failing to report any - outputs. Attempts to get the 1st display-output from the - 1st display-adapter can fail, with IDXGIAdapter::EnumOutputs - returning DXGI_ERROR_NOT_FOUND. This could be a bug in Windows, - the Windows App Certification Kit, or possibly in SDL/WinRT's - display detection code. Either way, try to detect when this - happens, and use a hackish means to create a reasonable-as-possible - 'display mode'. -- DavidL - */ - if (adapterIndex == 0 && outputIndex == 0) { - SDL_VideoDisplay display; - SDL_DisplayMode mode; -#if SDL_WINRT_USE_APPLICATIONVIEW - ApplicationView ^ appView = ApplicationView::GetForCurrentView(); -#endif - CoreWindow ^ coreWin = CoreWindow::GetForCurrentThread(); - SDL_zero(display); - SDL_zero(mode); - display.name = SDL_strdup("DXGI Display-detection Workaround"); - - /* HACK: ApplicationView's VisibleBounds property, appeared, via testing, to - give a better approximation of display-size, than did CoreWindow's - Bounds property, insofar that ApplicationView::VisibleBounds seems like - it will, at least some of the time, give the full display size (during the - failing test), whereas CoreWindow might not. -- DavidL - */ - -#if (NTDDI_VERSION >= NTDDI_WIN10) || (SDL_WINRT_USE_APPLICATIONVIEW && SDL_WINAPI_FAMILY_PHONE) - mode.w = (int)SDL_floorf(appView->VisibleBounds.Width); - mode.h = (int)SDL_floorf(appView->VisibleBounds.Height); -#else - /* On platform(s) that do not support VisibleBounds, such as Windows 8.1, - fall back to CoreWindow's Bounds property. - */ - mode.w = (int)SDL_floorf(coreWin->Bounds.Width); - mode.h = (int)SDL_floorf(coreWin->Bounds.Height); -#endif - mode.pixel_density = WINRT_DISPLAY_PROPERTY(LogicalDpi) / 96.0f; - mode.format = D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM); - - display.desktop_mode = mode; - bool error = (SDL_AddVideoDisplay(&display, false) == 0); - if (display.name) { - SDL_free(display.name); - } - if (error) { - return SDL_SetError("Failed to apply DXGI Display-detection workaround"); - } - } - - break; - } - } - - dxgiAdapter1->Release(); - return true; -} - -bool WINRT_InitModes(SDL_VideoDevice *_this) -{ - /* HACK: Initialize a single display, for whatever screen the app's - CoreApplicationView is on. - TODO, WinRT: Try initializing multiple displays, one for each monitor. - Appropriate WinRT APIs for this seem elusive, though. -- DavidL - */ - - HRESULT hr; - IDXGIFactory2 *dxgiFactory2 = NULL; - - hr = CreateDXGIFactory1(SDL_IID_IDXGIFactory2, (void **)&dxgiFactory2); - if (FAILED(hr)) { - return WIN_SetErrorFromHRESULT(__FUNCTION__ ", CreateDXGIFactory1() failed", hr); - } - - for (int adapterIndex = 0;; ++adapterIndex) { - if (!WINRT_AddDisplaysForAdapter(_this, dxgiFactory2, adapterIndex)) { - break; - } - } - - return true; -} - -static bool WINRT_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) -{ - return true; -} - -void WINRT_VideoQuit(SDL_VideoDevice *_this) -{ - SDL_VideoData *internal = _this->internal; - if (internal && internal->displayRequest) { - internal->displayRequest->Release(); - internal->displayRequest = NULL; - } - WINRT_QuitGameBar(_this); - WINRT_QuitMouse(_this); -} - -static const SDL_WindowFlags WINRT_DetectableFlags = SDL_WINDOW_MAXIMIZED | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_HIDDEN | SDL_WINDOW_MOUSE_FOCUS; - -extern "C" SDL_WindowFlags -WINRT_DetectWindowFlags(SDL_Window *window) -{ - SDL_WindowFlags latestFlags = 0; - SDL_WindowData *data = window->internal; - bool is_fullscreen = false; - -#if SDL_WINRT_USE_APPLICATIONVIEW - if (data->appView) { - is_fullscreen = data->appView->IsFullScreenMode; - } -#elif SDL_WINAPI_FAMILY_PHONE || NTDDI_VERSION == NTDDI_WIN8 - is_fullscreen = true; -#endif - - if (data->coreWindow.Get()) { - if (is_fullscreen) { - SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - int w = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Width); - int h = WINRT_DIPS_TO_PHYSICAL_PIXELS(data->coreWindow->Bounds.Height); - -#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 SDL_WINAPI_FAMILY_PHONE - case DisplayOrientations::Landscape: - case DisplayOrientations::LandscapeFlipped: -#else - case DisplayOrientations::Portrait: - case DisplayOrientations::PortraitFlipped: -#endif - { - int tmp = w; - w = h; - h = tmp; - } break; - } -#endif - - if (display->desktop_mode.w != w || display->desktop_mode.h != h) { - latestFlags |= SDL_WINDOW_MAXIMIZED; - } else { - latestFlags |= SDL_WINDOW_FULLSCREEN; - } - } - - if (data->coreWindow->Visible) { - latestFlags &= ~SDL_WINDOW_HIDDEN; - } else { - latestFlags |= SDL_WINDOW_HIDDEN; - } - -#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 - if (data->coreWindow->Visible && data->coreWindow->Bounds.Contains(data->coreWindow->PointerPosition)) { - latestFlags |= SDL_WINDOW_MOUSE_FOCUS; - } -#endif - } - - return latestFlags; -} - -// TODO, WinRT: consider removing WINRT_UpdateWindowFlags, and just calling WINRT_DetectWindowFlags as-appropriate (with appropriate calls to SDL_SendWindowEvent) -void WINRT_UpdateWindowFlags(SDL_Window *window, SDL_WindowFlags mask) -{ - mask &= WINRT_DetectableFlags; - if (window) { - Uint32 apply = WINRT_DetectWindowFlags(window); - window->flags = (window->flags & ~mask) | (apply & mask); - } -} - -static bool WINRT_IsCoreWindowActive(CoreWindow ^ coreWindow) -{ - /* WinRT does not appear to offer API(s) to determine window-activation state, - at least not that I am aware of in Win8 - Win10. As such, SDL tracks this - itself, via window-activation events. - - If there *is* an API to track this, it should probably get used instead - of the following hack (that uses "SDLHelperWindowActivationState"). - -- DavidL. - */ - if (coreWindow->CustomProperties->HasKey("SDLHelperWindowActivationState")) { - CoreWindowActivationState activationState = - safe_cast(coreWindow->CustomProperties->Lookup("SDLHelperWindowActivationState")); - return activationState != CoreWindowActivationState::Deactivated; - } - - /* Assume that non-SDL tracked windows are active, although this should - probably be avoided, if possible. - - This might not even be possible, in normal SDL use, at least as of - this writing (Dec 22, 2015; via latest hg.libsdl.org/SDL clone) -- DavidL - */ - return true; -} - -bool WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) -{ - // Make sure that only one window gets created, at least until multimonitor - // support is added. - if (WINRT_GlobalSDLWindow != NULL) { - return SDL_SetError("WinRT only supports one window"); - } - - SDL_WindowData *data = new SDL_WindowData; // use 'new' here as SDL_WindowData may use WinRT/C++ types - if (!data) { - return SDL_OutOfMemory(); - } - window->internal = data; - data->sdlWindow = window; - data->high_surrogate = L'\0'; - - /* To note, when XAML support is enabled, access to the CoreWindow will not - be possible, at least not via the SDL/XAML thread. Attempts to access it - from there will throw exceptions. As such, the SDL_WindowData's - 'coreWindow' field will only be set (to a non-null value) if XAML isn't - enabled. - */ - if (!WINRT_XAMLWasEnabled) { - data->coreWindow = CoreWindow::GetForCurrentThread(); -#if SDL_WINRT_USE_APPLICATIONVIEW - data->appView = ApplicationView::GetForCurrentView(); -#endif - } - SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, reinterpret_cast(data->coreWindow.Get())); - - // Make note of the requested window flags, before they start getting changed. - const Uint32 requestedFlags = window->flags; - -#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. - data->egl_surface = EGL_NO_SURFACE; - } else { - // OpenGL ES 2 was requested. Set up an EGL surface. - SDL_VideoData *video_data = _this->internal; - - /* Call SDL_EGL_ChooseConfig and eglCreateWindowSurface directly, - * rather than via SDL_EGL_CreateSurface, as older versions of - * ANGLE/WinRT may require that a C++ object, ComPtr, - * be passed into eglCreateWindowSurface. - */ - if (!SDL_EGL_ChooseConfig(_this)) { - // SDL_EGL_ChooseConfig failed, SDL_GetError() should have info - return false; - } - - if (video_data->winrtEglWindow) { // ... is the 'old' version of ANGLE/WinRT being used? - /* Attempt to create a window surface using older versions of - * ANGLE/WinRT: - */ - Microsoft::WRL::ComPtr cpp_winrtEglWindow = video_data->winrtEglWindow; - data->egl_surface = ((eglCreateWindowSurface_Old_Function)_this->egl_data->eglCreateWindowSurface)( - _this->egl_data->egl_display, - _this->egl_data->egl_config, - cpp_winrtEglWindow, NULL); - if (data->egl_surface == NULL) { - return SDL_EGL_SetError("unable to create EGL native-window surface", "eglCreateWindowSurface"); - } - } else if (data->coreWindow.Get() != nullptr) { - /* Attempt to create a window surface using newer versions of - * ANGLE/WinRT: - */ - IInspectable *coreWindowAsIInspectable = reinterpret_cast(data->coreWindow.Get()); - data->egl_surface = _this->egl_data->eglCreateWindowSurface( - _this->egl_data->egl_display, - _this->egl_data->egl_config, - (NativeWindowType)coreWindowAsIInspectable, - NULL); - if (data->egl_surface == NULL) { - return SDL_EGL_SetError("unable to create EGL native-window surface", "eglCreateWindowSurface"); - } - } else { - return SDL_SetError("No supported means to create an EGL window surface are available"); - } - } -#endif - - // Determine as many flags dynamically, as possible. - window->flags = - SDL_WINDOW_BORDERLESS | - SDL_WINDOW_RESIZABLE; - -#ifdef SDL_VIDEO_OPENGL_EGL - if (data->egl_surface) { - window->flags |= SDL_WINDOW_OPENGL; - } -#endif - - if (WINRT_XAMLWasEnabled) { - // TODO, WinRT: set SDL_Window size, maybe position too, from XAML control - window->x = 0; - window->y = 0; - window->flags &= ~SDL_WINDOW_HIDDEN; - SDL_SetMouseFocus(NULL); // TODO: detect this - SDL_SetKeyboardFocus(NULL); // TODO: detect this - } else { - /* WinRT 8.x apps seem to live in an environment where the OS controls the - app's window size, with some apps being fullscreen, depending on - user choice of various things. For now, just adapt the SDL_Window to - whatever Windows set-up as the native-window's geometry. - */ - window->x = (int)SDL_lroundf(data->coreWindow->Bounds.Left); - window->y = (int)SDL_lroundf(data->coreWindow->Bounds.Top); -#if NTDDI_VERSION < NTDDI_WIN10 - // On WinRT 8.x / pre-Win10, just use the size we were given. - window->w = (int)SDL_floorf(data->coreWindow->Bounds.Width); - window->h = (int)SDL_floorf(data->coreWindow->Bounds.Height); -#else - /* On Windows 10, we occasionally get control over window size. For windowed - mode apps, try this. - */ - bool didSetSize = false; - if ((requestedFlags & SDL_WINDOW_FULLSCREEN) == 0) { - const Windows::Foundation::Size size((float)window->w, (float)window->h); - didSetSize = data->appView->TryResizeView(size); - } - if (!didSetSize) { - /* We either weren't able to set the window size, or a request for - fullscreen was made. Get window-size info from the OS. - */ - window->w = (int)SDL_floorf(data->coreWindow->Bounds.Width); - window->h = (int)SDL_floorf(data->coreWindow->Bounds.Height); - } -#endif - - WINRT_UpdateWindowFlags( - window, - 0xffffffff // Update any window flag(s) that WINRT_UpdateWindow can handle - ); - - // Try detecting if the window is active - bool isWindowActive = WINRT_IsCoreWindowActive(data->coreWindow.Get()); - if (isWindowActive) { - SDL_SetKeyboardFocus(window); - } - } - - /* Make sure the WinRT app's IFramworkView can post events on - behalf of SDL: - */ - WINRT_GlobalSDLWindow = window; - - // All done! - return true; -} - -void WINRT_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) -{ -#if NTDDI_VERSION >= NTDDI_WIN10 - SDL_WindowData *data = window->internal; - const Windows::Foundation::Size size((float)window->floating.w, (float)window->floating.h); - if (data->appView->TryResizeView(size)) { - SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window->floating.w, window->floating.h); - } -#endif -} - -SDL_FullscreenResult WINRT_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen) -{ -#if NTDDI_VERSION >= NTDDI_WIN10 - SDL_WindowData *data = window->internal; - bool isWindowActive = WINRT_IsCoreWindowActive(data->coreWindow.Get()); - if (isWindowActive) { - if (fullscreen) { - if (!data->appView->IsFullScreenMode) { - if (data->appView->TryEnterFullScreenMode()) { - return SDL_FULLSCREEN_SUCCEEDED; - } else { - return SDL_FULLSCREEN_FAILED; - } - } - } else { - if (data->appView->IsFullScreenMode) { - data->appView->ExitFullScreenMode(); - } - } - } -#endif - - return SDL_FULLSCREEN_SUCCEEDED; -} - -void WINRT_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) -{ - SDL_WindowData *data = window->internal; - - if (WINRT_GlobalSDLWindow == window) { - WINRT_GlobalSDLWindow = NULL; - } - - if (data) { - // Delete the internal window data: - delete data; - data = NULL; - window->internal = NULL; - } -} - -static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayRequest(SDL_VideoDevice *_this) -{ - // Setup a WinRT DisplayRequest object, usable for enabling/disabling screensaver requests - const wchar_t *wClassName = L"Windows.System.Display.DisplayRequest"; - HSTRING hClassName; - IActivationFactory *pActivationFactory = NULL; - IInspectable *pDisplayRequestRaw = nullptr; - ABI::Windows::System::Display::IDisplayRequest *pDisplayRequest = nullptr; - HRESULT hr; - - hr = ::WindowsCreateString(wClassName, (UINT32)SDL_wcslen(wClassName), &hClassName); - if (FAILED(hr)) { - goto done; - } - - hr = Windows::Foundation::GetActivationFactory(hClassName, &pActivationFactory); - if (FAILED(hr)) { - goto done; - } - - hr = pActivationFactory->ActivateInstance(&pDisplayRequestRaw); - if (FAILED(hr)) { - goto done; - } - - hr = pDisplayRequestRaw->QueryInterface(SDL_IID_IDisplayRequest, (void **)&pDisplayRequest); - if (FAILED(hr)) { - goto done; - } - -done: - if (pDisplayRequestRaw) { - pDisplayRequestRaw->Release(); - } - if (pActivationFactory) { - pActivationFactory->Release(); - } - if (hClassName) { - ::WindowsDeleteString(hClassName); - } - - return pDisplayRequest; -} - -bool WINRT_SuspendScreenSaver(SDL_VideoDevice *_this) -{ - SDL_VideoData *internal = _this->internal; - if (internal && internal->displayRequest) { - ABI::Windows::System::Display::IDisplayRequest *displayRequest = (ABI::Windows::System::Display::IDisplayRequest *)internal->displayRequest; - if (_this->suspend_screensaver) { - displayRequest->RequestActive(); - } else { - displayRequest->RequestRelease(); - } - } - return true; -} - -#endif // SDL_VIDEO_DRIVER_WINRT diff --git a/src/video/winrt/SDL_winrtvideo_cpp.h b/src/video/winrt/SDL_winrtvideo_cpp.h deleted file mode 100644 index 18fb58d82..000000000 --- a/src/video/winrt/SDL_winrtvideo_cpp.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -// Windows includes: -#include -#ifdef __cplusplus_winrt -#include -#endif - -// SDL includes: - -#if NTDDI_VERSION >= NTDDI_WINBLUE /* ApplicationView's functionality only becomes \ - useful for SDL in Win[Phone] 8.1 and up. \ - Plus, it is not available at all in WinPhone 8.0. */ -#define SDL_WINRT_USE_APPLICATIONVIEW 1 -#endif - -extern "C" { -#include "../SDL_sysvideo.h" -#include "../SDL_egl_c.h" -} - -// Private display data -struct SDL_VideoData -{ - /* An object created by ANGLE/WinRT (OpenGL ES 2 for WinRT) that gets - * passed to eglGetDisplay and eglCreateWindowSurface: - */ - IUnknown *winrtEglWindow; - - /* Event token(s), for unregistering WinRT event handler(s). - These are just a struct with a 64-bit integer inside them - */ - Windows::Foundation::EventRegistrationToken gameBarIsInputRedirectedToken; - - /* A WinRT DisplayRequest, used for implementing SDL_*ScreenSaver() functions. - * This is really a pointer to a 'ABI::Windows::System::Display::IDisplayRequest *', - * It's casted to 'IUnknown *', to help with building SDL. - */ - IUnknown *displayRequest; -}; - -/* The global, WinRT, SDL Window. - For now, SDL/WinRT only supports one window (due to platform limitations of - WinRT. -*/ -extern SDL_Window *WINRT_GlobalSDLWindow; - -/* Updates one or more SDL_Window flags, by querying the OS' native windowing APIs. - SDL_Window flags that can be updated should be specified in 'mask'. -*/ -extern void WINRT_UpdateWindowFlags(SDL_Window *window, SDL_WindowFlags mask); -extern "C" SDL_WindowFlags WINRT_DetectWindowFlags(SDL_Window *window); // detects flags w/o applying them - -// Display mode internals -// typedef struct -//{ -// Windows::Graphics::Display::DisplayOrientations currentOrientation; -// } SDL_DisplayModeData; - -#ifdef __cplusplus_winrt - -// A convenience macro to get a WinRT display property -#if NTDDI_VERSION > NTDDI_WIN8 -#define WINRT_DISPLAY_PROPERTY(NAME) (Windows::Graphics::Display::DisplayInformation::GetForCurrentView()->NAME) -#else -#define WINRT_DISPLAY_PROPERTY(NAME) (Windows::Graphics::Display::DisplayProperties::NAME) -#endif - -// Converts DIPS to/from physical pixels -#define WINRT_DIPS_TO_PHYSICAL_PIXELS(DIPS) ((int)(0.5f + (((float)(DIPS) * (float)WINRT_DISPLAY_PROPERTY(LogicalDpi)) / 96.f))) -#define WINRT_PHYSICAL_PIXELS_TO_DIPS(PHYSPIX) (((float)(PHYSPIX)*96.f) / WINRT_DISPLAY_PROPERTY(LogicalDpi)) - -// Internal window data -struct SDL_WindowData -{ - SDL_Window *sdlWindow; - Platform::Agile coreWindow; -#ifdef SDL_VIDEO_OPENGL_EGL - EGLSurface egl_surface; -#endif -#if SDL_WINRT_USE_APPLICATIONVIEW - Windows::UI::ViewManagement::ApplicationView ^ appView; -#endif - WCHAR high_surrogate; -}; - -#endif // ifdef __cplusplus_winrt diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5df28471e..59735410d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -32,12 +32,6 @@ if(NOT (MSVC AND SDL_CPU_ARM64)) find_package(OpenGL) endif() -if(WINDOWS_STORE) - cmake_minimum_required(VERSION 3.19) - # CMP0112: Target file component generator expressions do not add target dependencies. - cmake_policy(SET CMP0112 NEW) -endif() - set(SDL_TEST_EXECUTABLES) add_library(sdltests_utils OBJECT @@ -49,7 +43,7 @@ file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt) option(SDLTEST_TRACKMEM "Run tests with --trackmem" OFF) -if(WIN32 AND NOT WINDOWS_STORE) +if(WIN32) option(SDLTEST_PROCDUMP "Run tests using sdlprocdump for minidump generation" OFF) add_executable(sdlprocdump win32/sdlprocdump.c) set_property(TARGET sdlprocdump PROPERTY C_STANDARD "90") @@ -107,19 +101,6 @@ define_property(TARGET PROPERTY SDL_NONINTERACTIVE BRIEF_DOCS "If true, target i define_property(TARGET PROPERTY SDL_NONINTERACTIVE_ARGUMENTS BRIEF_DOCS "Argument(s) to run executable in non-interactive mode." FULL_DOCS "Argument(s) to run executable in non-interactive mode.") define_property(TARGET PROPERTY SDL_NONINTERACTIVE_TIMEOUT BRIEF_DOCS "Timeout for noninteractive executable." FULL_DOCS "Timeout for noninteractive executable.") -if(WINDOWS_STORE) - add_library(sdl_test_main_uwp OBJECT main.cpp) - target_link_libraries(sdl_test_main_uwp PRIVATE SDL3::Headers) - target_compile_options(sdl_test_main_uwp PRIVATE "/ZW") - - add_library(sdl_test_main_callbacks_uwp OBJECT main.cpp) - target_link_libraries(sdl_test_main_callbacks_uwp PRIVATE SDL3::Headers) - target_compile_options(sdl_test_main_callbacks_uwp PRIVATE "/ZW") - target_compile_definitions(sdl_test_main_callbacks_uwp PRIVATE "SDL_MAIN_USE_CALLBACKS") - - set_source_files_properties(${RESOURCE_FILES} PROPERTIES VS_DEPLOYENT_LOCATION "Assets") -endif() - macro(add_sdl_test_executable TARGET) cmake_parse_arguments(AST "BUILD_DEPENDENT;NONINTERACTIVE;NEEDS_RESOURCES;TESTUTILS;THREADS;NO_C90;MAIN_CALLBACKS;NOTRACKMEM" "" "DISABLE_THREADS_ARGS;NONINTERACTIVE_TIMEOUT;NONINTERACTIVE_ARGS;SOURCES" ${ARGN}) if(AST_UNPARSED_ARGUMENTS) @@ -132,32 +113,6 @@ macro(add_sdl_test_executable TARGET) list(APPEND AST_SOURCES $) endif() set(EXTRA_SOURCES "") - if(WINDOWS_STORE) - set(uwp_bindir "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.dir") - if(NOT IS_DIRECTORY "${uwp_bindir}") - execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${uwp_bindir}") - endif() - string(REGEX REPLACE "[_]" "" SAFE_TARGET "${TARGET}") - file(GENERATE OUTPUT "${uwp_bindir}/${TARGET}.appxmanifest" - INPUT "${CMAKE_CURRENT_SOURCE_DIR}/uwp/Package.appxmanifest.in" - TARGET "${TARGET}" - ) - set_property(SOURCE "${uwp_bindir}/${TARGET}.appxmanifest" PROPERTY VS_DEPLOYMENT_CONTENT 1) - - if(AST_MAIN_CALLBACKS) - list(APPEND EXTRA_SOURCES "$") - else() - list(APPEND EXTRA_SOURCES "$") - endif() - - list(APPEND EXTRA_SOURCES - "${uwp_bindir}/${TARGET}.appxmanifest" - "uwp/logo-50x50.png" - "uwp/square-44x44.png" - "uwp/square-150x150.png" - "uwp/splash-620x300.png" - ) - endif() if(AST_NEEDS_RESOURCES) list(APPEND EXTRA_SOURCES ${RESOURCE_FILES}) endif() @@ -192,16 +147,6 @@ macro(add_sdl_test_executable TARGET) add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E make_directory $/sdl-${TARGET} COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILES} $/sdl-${TARGET}) - elseif(WINDOWS_STORE) - # MSVC does build the dependent targets (or POST_BUILD commands) when building an application - # after starting to debug. By copying the resources in a custom target, the files can be copied afterwards. - # FIXME: find out proper way to add assets to UWP package - cmake_minimum_required(VERSION 3.19) - add_custom_target(zzz-resources-copy-${TARGET} - COMMAND ${CMAKE_COMMAND} -E make_directory "$/AppX" - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RESOURCE_FILES} "$/AppX" - ) - add_dependencies(${TARGET} zzz-resources-copy-${TARGET}) else() add_dependencies(${TARGET} copy-sdl-test-resources) endif() @@ -233,20 +178,7 @@ macro(add_sdl_test_executable TARGET) endif() elseif(PSP) target_link_libraries(${TARGET} PRIVATE GL) - endif() - if(WINDOWS_STORE) - target_compile_definitions(${TARGET} PRIVATE "SDL_MAIN_NOIMPL") - set_property(TARGET ${TARGET} PROPERTY WIN32_EXECUTABLE TRUE) - set_property(TARGET ${TARGET} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${uwp_bindir}") - target_link_options(${TARGET} PRIVATE - -nodefaultlib:vccorlib$<$:d> - -nodefaultlib:msvcrt$<$:d> - vccorlib$<$:d>.lib - msvcrt$<$:d>.lib - ) - endif() - - if(EMSCRIPTEN) + elseif(EMSCRIPTEN) set_property(TARGET ${TARGET} PROPERTY SUFFIX ".html") target_link_options(${TARGET} PRIVATE "SHELL:--pre-js ${CMAKE_CURRENT_SOURCE_DIR}/emscripten/pre.js") target_link_options(${TARGET} PRIVATE "-sEXIT_RUNTIME=1") diff --git a/test/uwp/Package.appxmanifest.in b/test/uwp/Package.appxmanifest.in deleted file mode 100644 index 8a5d43714..000000000 --- a/test/uwp/Package.appxmanifest.in +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - $ - libsdl.org - logo-50x50.png - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/uwp/logo-50x50.png b/test/uwp/logo-50x50.png deleted file mode 100644 index e7903b79f11b0d662db06725c36893dca3646544..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2421 zcmV-*35xcKP)Ve=Y{T7k?QSBPYM5MeUg}|M_JHhJ*fy=R017JDO2FwX(AX13b0-eAp zRF47cu^gWVfNC%BG*A}KKx7b6{Sf#72n6p<;AP-vAu>KxJHwec^F%~Eh}<#2%tjy! zkyrp!w*ys(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5V7`yUjR=6t4qD(me1%oczao#cS*pICF!|Eoy%&s z_O44v`=yG6=2q=CY|j9#KsNC1@d*K@cO2w%Pr{V7-i&`3wm=v+<>AJ%lCXs*fI8)X z;vZN$d$CiuJllIbv~~u+$D@O?%<6tC)3u{GG*CVnK>jZ-qj8dP| zGh@M_+G{q%C&vNyLyoB9I-LsZ4a|od%2$W>(5=AVR#t6@cAI|xm+tt$<7t^)%}%!o zm>@pT10cJAbqQ@fZ+!7ZX-^oxjsfk%Vi5DCLTFuQ<4QWYRVxpuHGGtKV#qDAT0JIl&;X)h|pk45Gno5x>!H+Qo08cAM%rL4B$Y z1Mz?Dx2b6}?bm5Q%M6j$fQ^8|?D^6(?O7^jJvK+8U9~G19-P=npJW7!kbA zR=82YJ{;ZDyu#dJJ>wKUqjQSq^&cDF*{{f4;5MvADjBFj^{+!Ko;eJC_G_KX<^!?7 zVPGYyUwzMhoiYX|B616G16E0LH>%ZV!l~22;Gt!;v6Hb@!8}t=oem=F|B-Kj$T-CQ n4se!8q~R=)NW)nok%s>Q9U2niUnbeS00000NkvXXu0mjfuSkNP diff --git a/test/uwp/splash-620x300.png b/test/uwp/splash-620x300.png deleted file mode 100644 index 0dde7737d6eb2aaa68d0eb795583d9875cb30445..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30918 zcmXtf1z6MH_y1_=25B9oG!oJwEg>;r^ae%i{4;qBvqU-kD3eqxtg76<%iR$AyjY4vL=ET$P8`gJ?Zv`wBk!KHr@!r6 zm!e;1Uh`ffUDH&>{F-OS4p+|bgCckRiV1E-o&8!5n^L9J z()dym)jW8*qK@QiqJ{LE)i|$l$MF?ZHn!bz{(DXc``nC&Y5-nYA+tsa#UVFR5J}}k zDo5#tCxAl%u*T29If^boMMldN-j||6zc-7d#A>RSQm$7^?vE`kVoN6it}b zNO&mWMU9=plF0J4v@2jMZte&`Fz)9#hPBraT>*{13nj2dg^pYme;aRxpas_fm+@W4 z1shEYA#F4@Y6yDGHY*s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3+Gg*wf~{~zzsH9&N^t? zQorx67v^v)h`i4K$bw*|!3*}g{qA;`STuI(^^}v8o@Jkd({w6ZUwlwF$NjfdH})TH zhPOI~yDA#pm#6}(Li$Oh8p2T3cl~-Sj)p$4ds%Zo?h}Nn-ljlD%vbx!3h7H^y-`jO zB>XJ*#{Fl{oD%QdEM`;a@4%^C2 zs}&C;zKU zz!MBsL&x^K;bZ8c0Y**}(H z4nGgStP`^kdp`c;Pl9h}&0$TiSYDa4~k-&Ve=4`=KK@iCXUt0Wbd%X66Hds z{Ouz^VWW*v z;n-9r??aoMBEi1zpx}m5A-rv&`oR9JqjQKEPE?GEe)?;!9u5G^{?SS8kuYvrbBTcXc z#koE0@UlaDlgbx@X5Pi!*s|M}KvtV5sd&{Y7v(o~9Pp7!?a>=+3eHKrZu%y?59^Kv z@$-ac1$TvB_bvIVy$E2isNxO8*%N);dm4|-|GB7)DjFPE?;g_wRP~GIVij3c0RMlR;e#J;)nad~&yMd)t0a=Vv@#GbX&m@}rhUN6 diff --git a/test/uwp/square-44x44.png b/test/uwp/square-44x44.png deleted file mode 100644 index f0bdcd22488bbac7b2cb8a95c53fa439114eb01e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2082 zcmV+-2;KLIP)h($8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H12d_y) zK~z|U?U;K|RQDCfKj+?MVOe11r3iv3s5Qj#k*Yv6qfULMlNwu11>@8t65Fx16BEbA zW}KL5o6e*U+l)11O~s<^nA+5-+GsLrO+{->9kE70OhH}?sQ3VdecaPOSaglMqM546 zjNh3%bAOL>&i8lj`Tg!WKT%b_NHFd6&mEQ;;Fo{` z<)|J7eh#caBs!Gn{qk@Y;0G3>+JHzpU16~v)q{xi2IA=Q_>EB2d;fq-;V%kBL49i! zqI;6PHz6T15|REvUb+bE0Ad2;0vrOK>QU9LvbB`q^PQ&CH`zk60fz|Hs#LfS4nCr~ z(h8oNnm_MJMX!a}z|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