@@ -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$<$<CONFIG:Debug>:Debug>DLL'")
|
||||
else:
|
||||
job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>:Debug>'")
|
||||
|
||||
job.cmake_arguments.append("'-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded$<$<CONFIG:Debug>: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:
|
||||
|
||||
@@ -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 "$<$<COMPILE_LANGUAGE:CXX>:/ZW>" "$<$<COMPILE_LANGUAGE:CXX>:-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 $<$<COMPILE_LANGUAGE:C,CXX>:/GS-> $<$<COMPILE_LANGUAGE:C,CXX>:/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$<$<CONFIG:Debug>:d>.lib
|
||||
msvcrt$<$<CONFIG:Debug>:d>.lib
|
||||
LINK_OPTIONS
|
||||
/nodefaultlib:vccorlib$<$<CONFIG:Debug>:d>
|
||||
/nodefaultlib:msvcrt$<$<CONFIG:Debug>: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")
|
||||
|
||||
@@ -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
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
@@ -1,49 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
IgnorableNamespaces="uap mp">
|
||||
|
||||
<Identity
|
||||
Name="a430d85b-5cf1-4705-9fe1-7da520f91d4b"
|
||||
Publisher="CN=Daniel"
|
||||
Version="1.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="a430d85b-5cf1-4705-9fe1-7da520f91d4b" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>testdraw</DisplayName>
|
||||
<PublisherDisplayName>Daniel</PublisherDisplayName>
|
||||
<Logo>Assets\StoreLogo.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate"/>
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App"
|
||||
Executable="$targetnametoken$.exe"
|
||||
EntryPoint="testdraw.App">
|
||||
<uap:VisualElements
|
||||
DisplayName="testdraw"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="testdraw"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
</Capabilities>
|
||||
</Package>
|
||||
@@ -1,335 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{95943bbe-f378-4068-a3fd-dae1b8309b6e}</ProjectGuid>
|
||||
<Keyword>DirectXApp</Keyword>
|
||||
<RootNamespace>testdraw</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
<ApplicationType>Windows Store</ApplicationType>
|
||||
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
|
||||
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
|
||||
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.props" />
|
||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\MeshContentTask.props" />
|
||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ShaderGraphContentTask.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm; $(VCInstallDir)\lib\arm</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm64; $(VCInstallDir)\lib\arm64</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\arm64; $(VCInstallDir)\lib\arm64</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store; $(VCInstallDir)\lib</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>d2d1.lib; d3d11.lib; dxgi.lib; windowscodecs.lib; dwrite.lib; %(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories); $(VCInstallDir)\lib\store\amd64; $(VCInstallDir)\lib\amd64</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>/nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
<ClCompile>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);..\..\include</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CompileAsWinRT>false</CompileAsWinRT>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(TreatWarningsAsError)'!=''">
|
||||
<ClCompile>
|
||||
<TreatWarningAsError>$(TreatWarningsAsError)</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Image Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Image Include="Assets\StoreLogo.png" />
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SDL-UWP.vcxproj">
|
||||
<Project>{89e9b32e-a86a-47c3-a948-d2b1622925ce}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_assert.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_common.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_compare.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_crc32.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_font.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_harness.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_log.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_md5.c" />
|
||||
<ClCompile Include="..\..\src\test\SDL_test_memory.c" />
|
||||
<ClCompile Include="..\..\test\main.cpp">
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\test\testdraw.c">
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">false</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">false</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
|
||||
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\src\main\winrt\SDL3-WinRTResource_BlankCursor.cur" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\src\main\winrt\SDL3-WinRTResources.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ImageContentTask.targets" />
|
||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\MeshContentTask.targets" />
|
||||
<Import Project="$(VSINSTALLDIR)\Common7\IDE\Extensions\Microsoft\VsGraphics\ShaderGraphContentTask.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Common">
|
||||
<UniqueIdentifier>95943bbe-f378-4068-a3fd-dae1b8309b6e</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Assets">
|
||||
<UniqueIdentifier>dad3d573-ab33-428d-ae70-6098066c27e7</UniqueIdentifier>
|
||||
<Extensions>bmp;fbx;gif;jpg;jpeg;tga;tiff;tif;png</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Content">
|
||||
<UniqueIdentifier>e4caa635-e149-44c2-8915-48ffa6ac48f7</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Image Include="Assets\LockScreenLogo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\SplashScreen.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square150x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
<Image Include="Assets\Wide310x150Logo.scale-200.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Assets\StoreLogo.png">
|
||||
<Filter>Assets</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AppxManifest Include="Package.appxmanifest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\test\main.cpp">
|
||||
<Filter>Content</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\test\testdraw.c">
|
||||
<Filter>Content</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_assert.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_common.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_compare.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_crc32.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_font.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_fuzzer.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_harness.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_log.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_md5.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\test\SDL_test_memory.c">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\src\main\winrt\SDL3-WinRTResource_BlankCursor.cur" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\src\main\winrt\SDL3-WinRTResources.rc" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -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
|
||||
(...)
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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("$<$<COMPILE_LANGUAGE:CXX>:/ZW>")
|
||||
set_source_files_properties(ain_cli.c main_gui.c PROPERTIES LANGUAGE CXX)
|
||||
endif()
|
||||
|
||||
include(GenerateExportHeader)
|
||||
|
||||
if(ANDROID)
|
||||
|
||||
@@ -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 <SDL3/SDL_main.h>` 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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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++
|
||||
|
||||
@@ -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 <SDL3/SDL_main.h>` 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 <Win32Resource> within the
|
||||
first <PropertyGroup> 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 <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
|
||||
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
|
||||
<http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx>
|
||||
|
||||
General information on using the C runtime in WinRT can be found at
|
||||
<https://msdn.microsoft.com/en-us/library/hh972425.aspx>
|
||||
|
||||
A list of supported Win32 APIs for WinRT apps can be found at
|
||||
<http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx>. To note,
|
||||
the list of supported Win32 APIs for Windows Phone 8.0 is different.
|
||||
That list can be found at
|
||||
<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662956(v=vs.105).aspx>
|
||||
|
||||
|
||||
### 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
|
||||
<https://msdn.microsoft.com/en-us/library/hh441469.aspx>. 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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 "$<TARGET_OBJECTS:sdl_example_main_callbacks_uwp>")
|
||||
|
||||
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} $<TARGET_FILE_DIR:${TARGET}>/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 "$<TARGET_FILE_DIR:${TARGET}>/AppX"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${AST_DATAFILES} "$<TARGET_FILE_DIR:${TARGET}>/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$<$<CONFIG:Debug>:d>
|
||||
-nodefaultlib:msvcrt$<$<CONFIG:Debug>:d>
|
||||
vccorlib$<$<CONFIG:Debug>:d>.lib
|
||||
msvcrt$<$<CONFIG:Debug>:d>.lib
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
elseif(EMSCRIPTEN)
|
||||
set_property(TARGET ${TARGET} PROPERTY SUFFIX ".html")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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".
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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 <SDL3/SDL_main.h>`
|
||||
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 <SDL3/SDL_main_impl.h>
|
||||
|
||||
#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 <SDL3/SDL_main_impl.h>
|
||||
#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_ */
|
||||
|
||||
@@ -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 <wrl.h>
|
||||
|
||||
/* 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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include <SDL3/SDL_atomic.h>
|
||||
#include <SDL3/SDL_mutex.h>
|
||||
|
||||
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK)) && !defined(SDL_PLATFORM_WINRT)
|
||||
#if (defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK))
|
||||
#include <process.h> /* _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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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@
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
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 <SDL3/SDL_platform_defines.h>
|
||||
|
||||
/* 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 <sdkddkver.h>
|
||||
|
||||
/* 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_ */
|
||||
@@ -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 <unistd.h> // _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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,360 +0,0 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
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 <Windows.h>
|
||||
#include <windows.ui.core.h>
|
||||
#include <windows.devices.enumeration.h>
|
||||
#include <windows.media.devices.h>
|
||||
#include <wrl/implements.h>
|
||||
#include <collection.h>
|
||||
|
||||
extern "C" {
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
#include "../SDL_sysaudio.h"
|
||||
}
|
||||
|
||||
#define COBJMACROS
|
||||
#include <mmdeviceapi.h>
|
||||
#include <audioclient.h>
|
||||
|
||||
#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<Platform::String ^> 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<DeviceWatcher ^, DeviceInformation ^>([this](DeviceWatcher ^ sender, DeviceInformation ^ args) { OnDeviceAdded(sender, args); });
|
||||
removed_handler = watcher->Removed += ref new TypedEventHandler<DeviceWatcher ^, DeviceInformationUpdate ^>([this](DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) { OnDeviceRemoved(sender, args); });
|
||||
updated_handler = watcher->Updated += ref new TypedEventHandler<DeviceWatcher ^, DeviceInformationUpdate ^>([this](DeviceWatcher ^ sender, DeviceInformationUpdate ^ args) { OnDeviceUpdated(sender, args); });
|
||||
completed_handler = watcher->EnumerationCompleted += ref new TypedEventHandler<DeviceWatcher ^, Platform::Object ^>([this](DeviceWatcher ^ sender, Platform::Object ^ args) { OnEnumerationCompleted(sender, args); });
|
||||
if (recording) {
|
||||
default_changed_handler = MediaDevice::DefaultAudioCaptureDeviceChanged += ref new TypedEventHandler<Platform::Object ^, DefaultAudioCaptureDeviceChangedEventArgs ^>([this](Platform::Object ^ sender, DefaultAudioCaptureDeviceChangedEventArgs ^ args) { OnDefaultCaptureDeviceChanged(sender, args); });
|
||||
} else {
|
||||
default_changed_handler = MediaDevice::DefaultAudioRenderDeviceChanged += ref new TypedEventHandler<Platform::Object ^, DefaultAudioRenderDeviceChangedEventArgs ^>([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<unsigned char> ^ 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<RuntimeClassFlags<ClassicCom>, 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<SDL_WasapiActivationHandler> handler = Make<SDL_WasapiActivationHandler>();
|
||||
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)
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||