Windows GDK Support (#5830)

* Added GDK

* Simplfied checks in SDL_config_wingdk.h

* Added testgdk sample

* Added GDK readme

* Fixed error in merge of SDL_windows.h

* Additional GDK fixes

* OpenWatcom should not export _SDL_GDKGetTaskQueue

* Formatting fixes

* Moved initialization code into SDL_GDKRunApp
This commit is contained in:
chalonverse 2022-06-27 17:19:39 +00:00 committed by GitHub
parent 314bb5a1ed
commit 3b191580c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 4150 additions and 93 deletions

67
VisualC-GDK/SDL.sln Normal file
View File

@ -0,0 +1,67 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32414.318
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D69D5741-611F-4E14-8541-1FEE94F50B5A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2", "SDL\SDL.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2main", "SDLmain\SDLmain.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsprite2", "tests\testsprite2\testsprite2.vcxproj", "{40FB7794-D3C3-4CFE-BCF4-A80C96635682}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL2test", "SDLtest\SDLtest.vcxproj", "{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgamecontroller", "tests\testgamecontroller\testgamecontroller.vcxproj", "{55812185-D13C-4022-9C81-32E0F4A08305}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testgdk", "tests\testgdk\testgdk.vcxproj", "{1C9A3F71-35A5-4C56-B292-F4375B3C3649}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Gaming.Desktop.x64 = Debug|Gaming.Desktop.x64
Release|Gaming.Desktop.x64 = Release|Gaming.Desktop.x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
{40FB7794-D3C3-4CFE-BCF4-A80C96635682}.Release|Gaming.Desktop.x64.Deploy.0 = Release|Gaming.Desktop.x64
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{55812185-D13C-4022-9C81-32E0F4A08305}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|Gaming.Desktop.x64
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
{55812185-D13C-4022-9C81-32E0F4A08305}.Release|Gaming.Desktop.x64.Deploy.0 = Release|Gaming.Desktop.x64
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Debug|Gaming.Desktop.x64.Deploy.0 = Debug|Gaming.Desktop.x64
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Desktop.x64.ActiveCfg = Release|Gaming.Desktop.x64
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Desktop.x64.Build.0 = Release|Gaming.Desktop.x64
{1C9A3F71-35A5-4C56-B292-F4375B3C3649}.Release|Gaming.Desktop.x64.Deploy.0 = Release|Gaming.Desktop.x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{40FB7794-D3C3-4CFE-BCF4-A80C96635682} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{55812185-D13C-4022-9C81-32E0F4A08305} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
{1C9A3F71-35A5-4C56-B292-F4375B3C3649} = {D69D5741-611F-4E14-8541-1FEE94F50B5A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C320C9F2-1A8F-41D7-B02B-6338F872BCAD}
EndGlobalSection
EndGlobal

521
VisualC-GDK/SDL/SDL.vcxproj Normal file
View File

@ -0,0 +1,521 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2</ProjectName>
<ProjectGuid>{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}</ProjectGuid>
<RootNamespace>SDL</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;vcruntimed.lib;msvcrtd.lib;ucrtd.lib;msvcprtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/SDL.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>DLL_EXPORT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<Link>
<AdditionalDependencies>setupapi.lib;winmm.lib;imm32.lib;version.lib;xgameruntime.lib;vcruntime.lib;msvcrt.lib;ucrt.lib;msvcprt.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h" />
<ClInclude Include="..\..\include\close_code.h" />
<ClInclude Include="..\..\include\SDL.h" />
<ClInclude Include="..\..\include\SDL_assert.h" />
<ClInclude Include="..\..\include\SDL_atomic.h" />
<ClInclude Include="..\..\include\SDL_audio.h" />
<ClInclude Include="..\..\include\SDL_bits.h" />
<ClInclude Include="..\..\include\SDL_blendmode.h" />
<ClInclude Include="..\..\include\SDL_clipboard.h" />
<ClInclude Include="..\..\include\SDL_config.h" />
<ClInclude Include="..\..\include\SDL_config_wingdk.h" />
<ClInclude Include="..\..\include\SDL_copying.h" />
<ClInclude Include="..\..\include\SDL_cpuinfo.h" />
<ClInclude Include="..\..\include\SDL_egl.h" />
<ClInclude Include="..\..\include\SDL_endian.h" />
<ClInclude Include="..\..\include\SDL_error.h" />
<ClInclude Include="..\..\include\SDL_events.h" />
<ClInclude Include="..\..\include\SDL_filesystem.h" />
<ClInclude Include="..\..\include\SDL_gamecontroller.h" />
<ClInclude Include="..\..\include\SDL_gesture.h" />
<ClInclude Include="..\..\include\SDL_guid.h" />
<ClInclude Include="..\..\include\SDL_haptic.h" />
<ClInclude Include="..\..\include\SDL_hints.h" />
<ClInclude Include="..\..\include\SDL_hidapi.h" />
<ClInclude Include="..\..\include\SDL_joystick.h" />
<ClInclude Include="..\..\include\SDL_keyboard.h" />
<ClInclude Include="..\..\include\SDL_keycode.h" />
<ClInclude Include="..\..\include\SDL_loadso.h" />
<ClInclude Include="..\..\include\SDL_locale.h" />
<ClInclude Include="..\..\include\SDL_log.h" />
<ClInclude Include="..\..\include\SDL_main.h" />
<ClInclude Include="..\..\include\SDL_messagebox.h" />
<ClInclude Include="..\..\include\SDL_metal.h" />
<ClInclude Include="..\..\include\SDL_misc.h" />
<ClInclude Include="..\..\include\SDL_mouse.h" />
<ClInclude Include="..\..\include\SDL_mutex.h" />
<ClInclude Include="..\..\include\SDL_name.h" />
<ClInclude Include="..\..\include\SDL_opengl.h" />
<ClInclude Include="..\..\include\SDL_opengl_glext.h" />
<ClInclude Include="..\..\include\SDL_opengles.h" />
<ClInclude Include="..\..\include\SDL_opengles2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2ext.h" />
<ClInclude Include="..\..\include\SDL_opengles2_gl2platform.h" />
<ClInclude Include="..\..\include\SDL_opengles2_khrplatform.h" />
<ClInclude Include="..\..\include\SDL_pixels.h" />
<ClInclude Include="..\..\include\SDL_platform.h" />
<ClInclude Include="..\..\include\SDL_power.h" />
<ClInclude Include="..\..\include\SDL_quit.h" />
<ClInclude Include="..\..\include\SDL_rect.h" />
<ClInclude Include="..\..\include\SDL_render.h" />
<ClInclude Include="..\..\include\SDL_revision.h" />
<ClInclude Include="..\..\include\SDL_rwops.h" />
<ClInclude Include="..\..\include\SDL_scancode.h" />
<ClInclude Include="..\..\include\SDL_sensor.h" />
<ClInclude Include="..\..\include\SDL_shape.h" />
<ClInclude Include="..\..\include\SDL_stdinc.h" />
<ClInclude Include="..\..\include\SDL_surface.h" />
<ClInclude Include="..\..\include\SDL_system.h" />
<ClInclude Include="..\..\include\SDL_syswm.h" />
<ClInclude Include="..\..\include\SDL_test.h" />
<ClInclude Include="..\..\include\SDL_test_assert.h" />
<ClInclude Include="..\..\include\SDL_test_common.h" />
<ClInclude Include="..\..\include\SDL_test_compare.h" />
<ClInclude Include="..\..\include\SDL_test_crc32.h" />
<ClInclude Include="..\..\include\SDL_test_font.h" />
<ClInclude Include="..\..\include\SDL_test_fuzzer.h" />
<ClInclude Include="..\..\include\SDL_test_harness.h" />
<ClInclude Include="..\..\include\SDL_test_images.h" />
<ClInclude Include="..\..\include\SDL_test_log.h" />
<ClInclude Include="..\..\include\SDL_test_md5.h" />
<ClInclude Include="..\..\include\SDL_test_memory.h" />
<ClInclude Include="..\..\include\SDL_test_random.h" />
<ClInclude Include="..\..\include\SDL_thread.h" />
<ClInclude Include="..\..\include\SDL_timer.h" />
<ClInclude Include="..\..\include\SDL_touch.h" />
<ClInclude Include="..\..\include\SDL_types.h" />
<ClInclude Include="..\..\include\SDL_version.h" />
<ClInclude Include="..\..\include\SDL_video.h" />
<ClInclude Include="..\..\include\SDL_vulkan.h" />
<ClInclude Include="..\..\src\audio\directsound\SDL_directsound.h" />
<ClInclude Include="..\..\src\audio\disk\SDL_diskaudio.h" />
<ClInclude Include="..\..\src\audio\dummy\SDL_dummyaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_audio_c.h" />
<ClInclude Include="..\..\src\audio\SDL_audiodev_c.h" />
<ClInclude Include="..\..\src\audio\SDL_sysaudio.h" />
<ClInclude Include="..\..\src\audio\SDL_wave.h" />
<ClInclude Include="..\..\src\audio\wasapi\SDL_wasapi.h" />
<ClInclude Include="..\..\src\audio\winmm\SDL_winmm.h" />
<ClInclude Include="..\..\src\core\gdk\SDL_gdk.h" />
<ClInclude Include="..\..\src\core\windows\SDL_directx.h" />
<ClInclude Include="..\..\src\core\windows\SDL_hid.h" />
<ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
<ClInclude Include="..\..\src\core\windows\SDL_xinput.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h" />
<ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h" />
<ClInclude Include="..\..\src\events\blank_cursor.h" />
<ClInclude Include="..\..\src\events\default_cursor.h" />
<ClInclude Include="..\..\src\events\scancodes_windows.h" />
<ClInclude Include="..\..\src\events\SDL_clipboardevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_displayevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_dropevents_c.h" />
<ClInclude Include="..\..\src\events\SDL_events_c.h" />
<ClInclude Include="..\..\src\events\SDL_gesture_c.h" />
<ClInclude Include="..\..\src\events\SDL_keyboard_c.h" />
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
<ClInclude Include="..\..\src\events\SDL_sysevents.h" />
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
<ClInclude Include="..\..\src\events\SDL_windowevents_c.h" />
<ClInclude Include="..\..\src\haptic\SDL_haptic_c.h" />
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_dinputhaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_windowshaptic_c.h" />
<ClInclude Include="..\..\src\haptic\windows\SDL_xinputhaptic_c.h" />
<ClInclude Include="..\..\src\hidapi\hidapi\hidapi.h" />
<ClInclude Include="..\..\src\hidapi\SDL_hidapi_c.h" />
<ClInclude Include="..\..\src\joystick\controller_type.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapijoystick_c.h" />
<ClInclude Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.h" />
<ClInclude Include="..\..\src\joystick\SDL_gamecontrollerdb.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
<ClInclude Include="..\..\src\joystick\usb_ids.h" />
<ClInclude Include="..\..\src\joystick\virtual\SDL_virtualjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_dinputjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_rawinputjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_windowsjoystick_c.h" />
<ClInclude Include="..\..\src\joystick\windows\SDL_xinputjoystick_c.h" />
<ClInclude Include="..\..\src\libm\math_libm.h" />
<ClInclude Include="..\..\src\libm\math_private.h" />
<ClInclude Include="..\..\src\locale\SDL_syslocale.h" />
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
<ClInclude Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.h" />
<ClInclude Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.h" />
<ClInclude Include="..\..\src\render\direct3d\SDL_shaders_d3d.h" />
<ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h" />
<ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.h" />
<ClInclude Include="..\..\src\render\opengl\SDL_glfuncs.h" />
<ClInclude Include="..\..\src\render\opengl\SDL_shaders_gl.h" />
<ClInclude Include="..\..\src\render\SDL_d3dmath.h" />
<ClInclude Include="..\..\src\render\SDL_sysrender.h" />
<ClInclude Include="..\..\src\render\SDL_yuv_sw_c.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendfillrect.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendline.h" />
<ClInclude Include="..\..\src\render\software\SDL_blendpoint.h" />
<ClInclude Include="..\..\src\render\software\SDL_draw.h" />
<ClInclude Include="..\..\src\render\software\SDL_drawline.h" />
<ClInclude Include="..\..\src\render\software\SDL_drawpoint.h" />
<ClInclude Include="..\..\src\render\software\SDL_render_sw_c.h" />
<ClInclude Include="..\..\src\render\software\SDL_rotate.h" />
<ClInclude Include="..\..\src\render\software\SDL_triangle.h" />
<ClInclude Include="..\..\src\SDL_assert_c.h" />
<ClInclude Include="..\..\src\SDL_dataqueue.h" />
<ClInclude Include="..\..\src\SDL_error_c.h" />
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp" />
<ClCompile Include="..\..\src\SDL_guid.c" />
<ClInclude Include="..\..\src\SDL_hints_c.h" />
<ClInclude Include="..\..\src\SDL_internal.h" />
<ClInclude Include="..\..\src\SDL_list.h" />
<ClInclude Include="..\..\src\SDL_log_c.h" />
<ClInclude Include="..\..\src\sensor\dummy\SDL_dummysensor.h" />
<ClInclude Include="..\..\src\sensor\SDL_sensor_c.h" />
<ClInclude Include="..\..\src\sensor\SDL_syssensor.h" />
<ClInclude Include="..\..\src\sensor\windows\SDL_windowssensor.h" />
<ClInclude Include="..\..\src\thread\SDL_systhread.h" />
<ClInclude Include="..\..\src\thread\SDL_thread_c.h" />
<ClInclude Include="..\..\src\thread\generic\SDL_syscond_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_sysmutex_c.h" />
<ClInclude Include="..\..\src\thread\windows\SDL_systhread_c.h" />
<ClInclude Include="..\..\src\timer\SDL_timer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullevents_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullframebuffer_c.h" />
<ClInclude Include="..\..\src\video\dummy\SDL_nullvideo.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_icd.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_layer.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_platform.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vk_sdk_platform.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan.hpp" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_android.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_beta.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_core.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_directfb.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_fuchsia.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_ggp.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_ios.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_macos.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_metal.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_vi.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_wayland.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_win32.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xcb.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib.h" />
<ClInclude Include="..\..\src\video\khronos\vulkan\vulkan_xlib_xrandr.h" />
<ClInclude Include="..\..\src\video\SDL_blit.h" />
<ClInclude Include="..\..\src\video\SDL_blit_auto.h" />
<ClInclude Include="..\..\src\video\SDL_blit_copy.h" />
<ClInclude Include="..\..\src\video\SDL_blit_slow.h" />
<ClInclude Include="..\..\src\video\SDL_egl_c.h" />
<ClInclude Include="..\..\src\video\SDL_pixels_c.h" />
<ClInclude Include="..\..\src\video\SDL_rect_c.h" />
<ClInclude Include="..\..\src\video\SDL_RLEaccel_c.h" />
<ClInclude Include="..\..\src\video\SDL_shape_internals.h" />
<ClInclude Include="..\..\src\video\SDL_sysvideo.h" />
<ClInclude Include="..\..\src\video\SDL_vulkan_internal.h" />
<ClInclude Include="..\..\src\video\SDL_yuv_c.h" />
<ClInclude Include="..\..\src\video\windows\SDL_msctf.h" />
<ClInclude Include="..\..\src\video\windows\SDL_vkeys.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsclipboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsevents.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsframebuffer.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowskeyboard.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmessagebox.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmodes.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsmouse.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengl.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsopengles.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsshape.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowstaskdialog.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvideo.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowsvulkan.h" />
<ClInclude Include="..\..\src\video\windows\SDL_windowswindow.h" />
<ClInclude Include="..\..\src\video\windows\wmmsg.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_sse_func.h" />
<ClInclude Include="..\..\src\video\yuv2rgb\yuv_rgb_std_func.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c" />
<ClCompile Include="..\..\src\atomic\SDL_spinlock.c" />
<ClCompile Include="..\..\src\audio\directsound\SDL_directsound.c" />
<ClCompile Include="..\..\src\audio\disk\SDL_diskaudio.c" />
<ClCompile Include="..\..\src\audio\dummy\SDL_dummyaudio.c" />
<ClCompile Include="..\..\src\audio\SDL_audio.c" />
<ClCompile Include="..\..\src\audio\SDL_audiocvt.c" />
<ClCompile Include="..\..\src\audio\SDL_audiodev.c" />
<ClCompile Include="..\..\src\audio\SDL_audiotypecvt.c" />
<ClCompile Include="..\..\src\audio\SDL_mixer.c" />
<ClCompile Include="..\..\src\audio\SDL_wave.c" />
<ClCompile Include="..\..\src\audio\winmm\SDL_winmm.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi.c" />
<ClCompile Include="..\..\src\audio\wasapi\SDL_wasapi_win32.c" />
<ClCompile Include="..\..\src\core\windows\SDL_hid.c" />
<ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
<ClCompile Include="..\..\src\core\windows\SDL_xinput.c" />
<ClCompile Include="..\..\src\cpuinfo\SDL_cpuinfo.c" />
<ClCompile Include="..\..\src\dynapi\SDL_dynapi.c" />
<ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
<ClCompile Include="..\..\src\events\SDL_displayevents.c" />
<ClCompile Include="..\..\src\events\SDL_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
<ClCompile Include="..\..\src\events\SDL_gesture.c" />
<ClCompile Include="..\..\src\events\SDL_keyboard.c" />
<ClCompile Include="..\..\src\events\SDL_mouse.c" />
<ClCompile Include="..\..\src\events\SDL_quit.c" />
<ClCompile Include="..\..\src\events\SDL_touch.c" />
<ClCompile Include="..\..\src\events\SDL_windowevents.c" />
<ClCompile Include="..\..\src\file\SDL_rwops.c" />
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfilesystem.c" />
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_dinputhaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_windowshaptic.c" />
<ClCompile Include="..\..\src\haptic\windows\SDL_xinputhaptic.c" />
<ClCompile Include="..\..\src\hidapi\SDL_hidapi.c" />
<ClCompile Include="..\..\src\joystick\controller_type.c" />
<ClCompile Include="..\..\src\joystick\dummy\SDL_sysjoystick.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapijoystick.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_gamecube.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_luna.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps4.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_ps5.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_rumble.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_stadia.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_switch.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xbox360w.c" />
<ClCompile Include="..\..\src\joystick\hidapi\SDL_hidapi_xboxone.c" />
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\virtual\SDL_virtualjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_dinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_rawinputjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_windowsjoystick.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_windows_gaming_input.c" />
<ClCompile Include="..\..\src\joystick\windows\SDL_xinputjoystick.c" />
<ClCompile Include="..\..\src\libm\e_atan2.c" />
<ClCompile Include="..\..\src\libm\e_exp.c" />
<ClCompile Include="..\..\src\libm\e_fmod.c" />
<ClCompile Include="..\..\src\libm\e_log.c" />
<ClCompile Include="..\..\src\libm\e_log10.c" />
<ClCompile Include="..\..\src\libm\e_pow.c" />
<ClCompile Include="..\..\src\libm\e_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\e_sqrt.c" />
<ClCompile Include="..\..\src\libm\k_cos.c" />
<ClCompile Include="..\..\src\libm\k_rem_pio2.c" />
<ClCompile Include="..\..\src\libm\k_sin.c" />
<ClCompile Include="..\..\src\libm\k_tan.c" />
<ClCompile Include="..\..\src\libm\s_atan.c" />
<ClCompile Include="..\..\src\libm\s_copysign.c" />
<ClCompile Include="..\..\src\libm\s_cos.c" />
<ClCompile Include="..\..\src\libm\s_fabs.c" />
<ClCompile Include="..\..\src\libm\s_floor.c" />
<ClCompile Include="..\..\src\libm\s_scalbn.c" />
<ClCompile Include="..\..\src\libm\s_sin.c" />
<ClCompile Include="..\..\src\libm\s_tan.c" />
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
<ClCompile Include="..\..\src\locale\SDL_locale.c" />
<ClCompile Include="..\..\src\locale\windows\SDL_syslocale.c" />
<ClCompile Include="..\..\src\misc\SDL_url.c" />
<ClCompile Include="..\..\src\misc\windows\SDL_sysurl.c" />
<ClCompile Include="..\..\src\power\SDL_power.c" />
<ClCompile Include="..\..\src\power\windows\SDL_syspower.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_shaders_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12.c" />
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_render_d3d.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d\SDL_shaders_d3d.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_render_gl.c" />
<ClCompile Include="..\..\src\render\opengl\SDL_shaders_gl.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_render_gles2.c" />
<ClCompile Include="..\..\src\render\opengles2\SDL_shaders_gles2.c" />
<ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendfillrect.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendline.c" />
<ClCompile Include="..\..\src\render\software\SDL_blendpoint.c" />
<ClCompile Include="..\..\src\render\software\SDL_drawline.c" />
<ClCompile Include="..\..\src\render\software\SDL_drawpoint.c" />
<ClCompile Include="..\..\src\render\software\SDL_render_sw.c" />
<ClCompile Include="..\..\src\render\software\SDL_rotate.c" />
<ClCompile Include="..\..\src\render\software\SDL_triangle.c" />
<ClCompile Include="..\..\src\SDL.c" />
<ClCompile Include="..\..\src\SDL_assert.c" />
<ClCompile Include="..\..\src\SDL_dataqueue.c" />
<ClCompile Include="..\..\src\SDL_list.c" />
<ClCompile Include="..\..\src\SDL_error.c" />
<ClCompile Include="..\..\src\SDL_hints.c" />
<ClCompile Include="..\..\src\SDL_log.c" />
<ClCompile Include="..\..\src\sensor\dummy\SDL_dummysensor.c" />
<ClCompile Include="..\..\src\sensor\SDL_sensor.c" />
<ClCompile Include="..\..\src\sensor\windows\SDL_windowssensor.c" />
<ClCompile Include="..\..\src\stdlib\SDL_crc32.c" />
<ClCompile Include="..\..\src\stdlib\SDL_getenv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_iconv.c" />
<ClCompile Include="..\..\src\stdlib\SDL_malloc.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memcpy.c" />
<ClCompile Include="..\..\src\stdlib\SDL_memset.c" />
<ClCompile Include="..\..\src\stdlib\SDL_qsort.c" />
<ClCompile Include="..\..\src\stdlib\SDL_stdlib.c" />
<ClCompile Include="..\..\src\stdlib\SDL_string.c" />
<ClCompile Include="..\..\src\stdlib\SDL_strtokr.c" />
<ClCompile Include="..\..\src\thread\generic\SDL_syscond.c" />
<ClCompile Include="..\..\src\thread\SDL_thread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syscond_cv.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_sysmutex.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_syssem.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systhread.c" />
<ClCompile Include="..\..\src\thread\windows\SDL_systls.c" />
<ClCompile Include="..\..\src\timer\SDL_timer.c" />
<ClCompile Include="..\..\src\timer\windows\SDL_systimer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullevents.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullframebuffer.c" />
<ClCompile Include="..\..\src\video\dummy\SDL_nullvideo.c" />
<ClCompile Include="..\..\src\video\SDL_blit.c" />
<ClCompile Include="..\..\src\video\SDL_blit_0.c" />
<ClCompile Include="..\..\src\video\SDL_blit_1.c" />
<ClCompile Include="..\..\src\video\SDL_blit_A.c" />
<ClCompile Include="..\..\src\video\SDL_blit_auto.c" />
<ClCompile Include="..\..\src\video\SDL_blit_copy.c" />
<ClCompile Include="..\..\src\video\SDL_blit_N.c" />
<ClCompile Include="..\..\src\video\SDL_blit_slow.c" />
<ClCompile Include="..\..\src\video\SDL_bmp.c" />
<ClCompile Include="..\..\src\video\SDL_clipboard.c" />
<ClCompile Include="..\..\src\video\SDL_egl.c" />
<ClCompile Include="..\..\src\video\SDL_fillrect.c" />
<ClCompile Include="..\..\src\video\SDL_pixels.c" />
<ClCompile Include="..\..\src\video\SDL_rect.c" />
<ClCompile Include="..\..\src\video\SDL_RLEaccel.c" />
<ClCompile Include="..\..\src\video\SDL_shape.c" />
<ClCompile Include="..\..\src\video\SDL_stretch.c" />
<ClCompile Include="..\..\src\video\SDL_surface.c" />
<ClCompile Include="..\..\src\video\SDL_video.c" />
<ClCompile Include="..\..\src\video\SDL_vulkan_utils.c" />
<ClCompile Include="..\..\src\video\SDL_yuv.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsclipboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsevents.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsframebuffer.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowskeyboard.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmessagebox.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmodes.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsmouse.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengl.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsopengles.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsshape.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvideo.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowsvulkan.c" />
<ClCompile Include="..\..\src\video\windows\SDL_windowswindow.c" />
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb.c" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\main\windows\version.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\main\gdk\SDL_gdk_main.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2main</ProjectName>
<ProjectGuid>{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}</ProjectGuid>
<RootNamespace>SDLmain</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>SDL2test</ProjectName>
<ProjectGuid>{DA956FD3-E143-46F2-9FE5-C77BEBC56B1A}</ProjectGuid>
<RootNamespace>SDLtest</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl />
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>false</BufferSecurityCheck>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<OmitDefaultLibName>true</OmitDefaultLibName>
</ClCompile>
</ItemDefinitionGroup>
<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_imageBlit.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageBlitBlend.c" />
<ClCompile Include="..\..\src\test\SDL_test_imageFace.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitives.c" />
<ClCompile Include="..\..\src\test\SDL_test_imagePrimitivesBlend.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="..\..\src\test\SDL_test_random.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

4
VisualC-GDK/clean.sh Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
find . -type f \( -name '*.user' -o -name '*.sdf' -o -name '*.ncb' -o -name '*.suo' \) -print -delete
find . -type f \( -name '*.bmp' -o -name '*.wav' -o -name '*.dat' \) -print -delete
find . -depth -type d \( -name Gaming.Desktop.x64 \) -exec rm -rv {} \;

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="1">
<!-- Set these to the correct identifiers from Partner Center -->
<Identity Name="41336MicrosoftATG.ATGSimpleLiveSample"
Version="1.0.0.0"
Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1"/>
<ExecutableList>
<Executable Name="testgamecontroller.exe"
TargetDeviceFamily="PC"
Id="Game" />
</ExecutableList>
<DesktopRegistration>
<DependencyList>
<KnownDependency Name="VC14"/>
</DependencyList>
</DesktopRegistration>
<!-- Set these to the correct values from Partner Center -->
<TitleId>7325F784</TitleId>
<MSAAppId>0000000000000000</MSAAppId>
<ShellVisuals DefaultDisplayName="testgamecontroller"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testgamecontroller"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>
</Game>

View File

@ -0,0 +1,9 @@
<Package>
<Chunk Id="1000" Marker="Launch">
<FileGroup DestinationPath="." SourcePath="." Include="testgamecontroller.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="MicrosoftGame.config" />
<FileGroup DestinationPath="." SourcePath="." Include="*.bmp" />
<FileGroup DestinationPath="." SourcePath="." Include="*.png" />
<FileGroup DestinationPath="." SourcePath="." Include="*.dll" />
</Chunk>
</Package>

View File

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{55812185-D13C-4022-9C81-32E0F4A08305}</ProjectGuid>
<RootNamespace>testgamecontroller</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testgamecontroller.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\axis.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\button.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\controllermap.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\..\test\controllermap_back.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testgamecontroller.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="MicrosoftGame.config">
<FileType>Document</FileType>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png" />
<CopyFileToFolders Include="..\..\logos\Logo150x150.png" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png" />
<CopyFileToFolders Include="..\..\logos\Logo480x480.png" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<FileType>Document</FileType>
</CopyFileToFolders>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testgamecontroller.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\controllermap_back.bmp" />
<CopyFileToFolders Include="..\..\..\test\axis.bmp" />
<CopyFileToFolders Include="..\..\..\test\button.bmp" />
<CopyFileToFolders Include="..\..\..\test\controllermap.bmp" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo150x150.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="MicrosoftGame.config" />
<CopyFileToFolders Include="PackageLayout.xml" />
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll" />
</ItemGroup>
<ItemGroup>
<Filter Include="logos">
<UniqueIdentifier>{5e858cf0-6fba-498d-b33d-11c8ecbb79c7}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="1">
<!-- Set these to the correct identifiers from Partner Center -->
<Identity Name="41336MicrosoftATG.ATGSimpleLiveSample"
Version="1.0.0.0"
Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1"/>
<ExecutableList>
<Executable Name="testgdk.exe"
TargetDeviceFamily="PC"
Id="Game" />
</ExecutableList>
<DesktopRegistration>
<DependencyList>
<KnownDependency Name="VC14"/>
</DependencyList>
</DesktopRegistration>
<!-- Set these to the correct values from Partner Center -->
<TitleId>7325F784</TitleId>
<MSAAppId>0000000000000000</MSAAppId>
<ShellVisuals DefaultDisplayName="testgdk"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testgdk"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>
</Game>

View File

@ -0,0 +1,9 @@
<Package>
<Chunk Id="1000" Marker="Launch">
<FileGroup DestinationPath="." SourcePath="." Include="testgdk.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="MicrosoftGame.config" />
<FileGroup DestinationPath="." SourcePath="." Include="*.bmp" />
<FileGroup DestinationPath="." SourcePath="." Include="*.png" />
<FileGroup DestinationPath="." SourcePath="." Include="*.dll" />
</Chunk>
</Package>

View File

@ -0,0 +1,398 @@
/*
Copyright (C) 1997-2022 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.
*/
/* testgdk: Basic tests of using task queue/xbl (with simple drawing) in GDK.
* NOTE: As of June 2022 GDK, login will only work if MicrosoftGame.config is
* configured properly. See README-gdk.md.
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "SDL_test.h"
#include "SDL_test_common.h"
#include "../src/core/windows/SDL_windows.h"
extern "C" {
#include "../test/testutils.h"
}
#include <XGameRuntime.h>
#define NUM_SPRITES 100
#define MAX_SPEED 1
static SDLTest_CommonState *state;
static int num_sprites;
static SDL_Texture **sprites;
static SDL_bool cycle_color;
static SDL_bool cycle_alpha;
static int cycle_direction = 1;
static int current_alpha = 0;
static int current_color = 0;
static int sprite_w, sprite_h;
static SDL_BlendMode blendMode = SDL_BLENDMODE_BLEND;
int done;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void
quit(int rc)
{
SDL_free(sprites);
SDLTest_CommonQuit(state);
/* If rc is 0, just let main return normally rather than calling exit.
* This allows testing of platforms where SDL_main is required and does meaningful cleanup.
*/
if (rc != 0) {
exit(rc);
}
}
void
UserLoggedIn(XUserHandle user)
{
HRESULT hr;
char gamertag[128];
hr = XUserGetGamertag(user, XUserGamertagComponent::UniqueModern, sizeof(gamertag), gamertag, NULL);
if (SUCCEEDED(hr)) {
SDL_Log("User logged in: %s", gamertag);
} else {
SDL_Log("[GDK] UserLoggedIn -- XUserGetGamertag failed: 0x%08x.", hr);
}
XUserCloseHandle(user);
}
void
AddUserUICallback(XAsyncBlock *asyncBlock)
{
HRESULT hr;
XUserHandle user = NULL;
hr = XUserAddResult(asyncBlock, &user);
if (SUCCEEDED(hr)) {
uint64_t userId;
hr = XUserGetId(user, &userId);
if (FAILED(hr)) {
/* If unable to get the user ID, it means the account is banned, etc. */
SDL_Log("[GDK] AddUserSilentCallback -- XUserGetId failed: 0x%08x.", hr);
XUserCloseHandle(user);
/* Per the docs, likely should call XUserResolveIssueWithUiAsync here. */
} else {
UserLoggedIn(user);
}
} else {
SDL_Log("[GDK] AddUserUICallback -- XUserAddAsync failed: 0x%08x.", hr);
}
delete asyncBlock;
}
void
AddUserUI()
{
HRESULT hr;
XAsyncBlock *asyncBlock = new XAsyncBlock;
asyncBlock->context = NULL;
asyncBlock->queue = NULL; /* A null queue will use the global process task queue */
asyncBlock->callback = &AddUserUICallback;
hr = XUserAddAsync(XUserAddOptions::None, asyncBlock);
if (FAILED(hr)) {
delete asyncBlock;
SDL_Log("[GDK] AddUserSilent -- failed: 0x%08x", hr);
}
}
void
AddUserSilentCallback(XAsyncBlock *asyncBlock)
{
HRESULT hr;
XUserHandle user = NULL;
hr = XUserAddResult(asyncBlock, &user);
if (SUCCEEDED(hr)) {
uint64_t userId;
hr = XUserGetId(user, &userId);
if (FAILED(hr)) {
/* If unable to get the user ID, it means the account is banned, etc. */
SDL_Log("[GDK] AddUserSilentCallback -- XUserGetId failed: 0x%08x. Trying with UI.", hr);
XUserCloseHandle(user);
AddUserUI();
} else {
UserLoggedIn(user);
}
} else {
SDL_Log("[GDK] AddUserSilentCallback -- XUserAddAsync failed: 0x%08x. Trying with UI.", hr);
AddUserUI();
}
delete asyncBlock;
}
void
AddUserSilent()
{
HRESULT hr;
XAsyncBlock *asyncBlock = new XAsyncBlock;
asyncBlock->context = NULL;
asyncBlock->queue = NULL; /* A null queue will use the global process task queue */
asyncBlock->callback = &AddUserSilentCallback;
hr = XUserAddAsync(XUserAddOptions::AddDefaultUserSilently, asyncBlock);
if (FAILED(hr)) {
delete asyncBlock;
SDL_Log("[GDK] AddUserSilent -- failed: 0x%08x", hr);
}
}
int
LoadSprite(const char *file)
{
int i;
for (i = 0; i < state->num_windows; ++i) {
/* This does the SDL_LoadBMP step repeatedly, but that's OK for test code. */
sprites[i] = LoadTexture(state->renderers[i], file, SDL_TRUE, &sprite_w, &sprite_h);
if (!sprites[i]) {
return (-1);
}
if (SDL_SetTextureBlendMode(sprites[i], blendMode) < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't set blend mode: %s\n", SDL_GetError());
SDL_DestroyTexture(sprites[i]);
return (-1);
}
}
/* We're ready to roll. :) */
return (0);
}
void
DrawSprites(SDL_Renderer * renderer, SDL_Texture * sprite)
{
SDL_Rect viewport, temp;
/* Query the sizes */
SDL_RenderGetViewport(renderer, &viewport);
/* Cycle the color and alpha, if desired */
if (cycle_color) {
current_color += cycle_direction;
if (current_color < 0) {
current_color = 0;
cycle_direction = -cycle_direction;
}
if (current_color > 255) {
current_color = 255;
cycle_direction = -cycle_direction;
}
SDL_SetTextureColorMod(sprite, 255, (Uint8) current_color,
(Uint8) current_color);
}
if (cycle_alpha) {
current_alpha += cycle_direction;
if (current_alpha < 0) {
current_alpha = 0;
cycle_direction = -cycle_direction;
}
if (current_alpha > 255) {
current_alpha = 255;
cycle_direction = -cycle_direction;
}
SDL_SetTextureAlphaMod(sprite, (Uint8) current_alpha);
}
/* Draw a gray background */
SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
SDL_RenderClear(renderer);
/* Test points */
SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0x00, 0xFF);
SDL_RenderDrawPoint(renderer, 0, 0);
SDL_RenderDrawPoint(renderer, viewport.w-1, 0);
SDL_RenderDrawPoint(renderer, 0, viewport.h-1);
SDL_RenderDrawPoint(renderer, viewport.w-1, viewport.h-1);
/* Test horizontal and vertical lines */
SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF);
SDL_RenderDrawLine(renderer, 1, 0, viewport.w-2, 0);
SDL_RenderDrawLine(renderer, 1, viewport.h-1, viewport.w-2, viewport.h-1);
SDL_RenderDrawLine(renderer, 0, 1, 0, viewport.h-2);
SDL_RenderDrawLine(renderer, viewport.w-1, 1, viewport.w-1, viewport.h-2);
/* Test fill and copy */
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF);
temp.x = 1;
temp.y = 1;
temp.w = sprite_w;
temp.h = sprite_h;
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
temp.x = viewport.w-sprite_w-1;
temp.y = 1;
temp.w = sprite_w;
temp.h = sprite_h;
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
temp.x = 1;
temp.y = viewport.h-sprite_h-1;
temp.w = sprite_w;
temp.h = sprite_h;
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
temp.x = viewport.w-sprite_w-1;
temp.y = viewport.h-sprite_h-1;
temp.w = sprite_w;
temp.h = sprite_h;
SDL_RenderFillRect(renderer, &temp);
SDL_RenderCopy(renderer, sprite, NULL, &temp);
/* Test diagonal lines */
SDL_SetRenderDrawColor(renderer, 0x00, 0xFF, 0x00, 0xFF);
SDL_RenderDrawLine(renderer, sprite_w, sprite_h,
viewport.w-sprite_w-2, viewport.h-sprite_h-2);
SDL_RenderDrawLine(renderer, viewport.w-sprite_w-2, sprite_h,
sprite_w, viewport.h-sprite_h-2);
/* Update the screen! */
SDL_RenderPresent(renderer);
}
void
loop()
{
int i;
SDL_Event event;
/* Check for events */
while (SDL_PollEvent(&event)) {
SDLTest_CommonEvent(state, &event, &done);
}
for (i = 0; i < state->num_windows; ++i) {
if (state->windows[i] == NULL)
continue;
DrawSprites(state->renderers[i], sprites[i]);
}
}
int
main(int argc, char *argv[])
{
int i;
const char *icon = "icon.bmp";
/* Initialize parameters */
num_sprites = NUM_SPRITES;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
if (!state) {
return 1;
}
for (i = 1; i < argc;) {
int consumed;
consumed = SDLTest_CommonArg(state, i);
if (consumed == 0) {
consumed = -1;
if (SDL_strcasecmp(argv[i], "--blend") == 0) {
if (argv[i + 1]) {
if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
blendMode = SDL_BLENDMODE_NONE;
consumed = 2;
} else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) {
blendMode = SDL_BLENDMODE_BLEND;
consumed = 2;
} else if (SDL_strcasecmp(argv[i + 1], "add") == 0) {
blendMode = SDL_BLENDMODE_ADD;
consumed = 2;
} else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) {
blendMode = SDL_BLENDMODE_MOD;
consumed = 2;
} else if (SDL_strcasecmp(argv[i + 1], "sub") == 0) {
blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT, SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_SUBTRACT);
consumed = 2;
}
}
} else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) {
cycle_color = SDL_TRUE;
consumed = 1;
} else if (SDL_strcasecmp(argv[i], "--cyclealpha") == 0) {
cycle_alpha = SDL_TRUE;
consumed = 1;
} else if (SDL_isdigit(*argv[i])) {
num_sprites = SDL_atoi(argv[i]);
consumed = 1;
} else if (argv[i][0] != '-') {
icon = argv[i];
consumed = 1;
}
}
if (consumed < 0) {
static const char *options[] = {
"[--blend none|blend|add|mod]",
"[--cyclecolor]",
"[--cyclealpha]",
"[num_sprites]",
"[icon.bmp]",
NULL };
SDLTest_CommonLogUsage(state, argv[0], options);
quit(1);
}
i += consumed;
}
if (!SDLTest_CommonInit(state)) {
quit(2);
}
/* Create the windows, initialize the renderers, and load the textures */
sprites =
(SDL_Texture **) SDL_malloc(state->num_windows * sizeof(*sprites));
if (!sprites) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!\n");
quit(2);
}
for (i = 0; i < state->num_windows; ++i) {
SDL_Renderer *renderer = state->renderers[i];
SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF);
SDL_RenderClear(renderer);
}
if (LoadSprite(icon) < 0) {
quit(2);
}
/* Main render loop */
done = 0;
/* Try to add the default user silently */
AddUserSilent();
while (!done) {
loop();
}
quit(0);
return 0;
}
/* vi: set ts=4 sw=4 expandtab: */

View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1C9A3F71-35A5-4C56-B292-F4375B3C3649}</ProjectGuid>
<RootNamespace>testsprite2</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\icon.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
copy "%(FullPath)" "$(OutDir)\"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
copy "%(FullPath)" "$(OutDir)\"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testutils.c" />
<ClCompile Include="src\testgdk.cpp" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="MicrosoftGame.config">
<FileType>Document</FileType>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<FileType>Document</FileType>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png" />
<CopyFileToFolders Include="..\..\logos\Logo150x150.png" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png" />
<CopyFileToFolders Include="..\..\logos\Logo480x480.png" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testutils.c" />
<ClCompile Include="src\testgdk.cpp" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\icon.bmp" />
<CopyFileToFolders Include="MicrosoftGame.config" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo150x150.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll" />
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<ItemGroup>
<Filter Include="logos">
<UniqueIdentifier>{c3c871f2-c7b7-4025-8ba4-037dde717fe1}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="1">
<!-- Set these to the correct identifiers from Partner Center -->
<Identity Name="41336MicrosoftATG.ATGSimpleLiveSample"
Version="1.0.0.0"
Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1"/>
<ExecutableList>
<Executable Name="testsprite2.exe"
TargetDeviceFamily="PC"
Id="Game" />
</ExecutableList>
<DesktopRegistration>
<DependencyList>
<KnownDependency Name="VC14"/>
</DependencyList>
</DesktopRegistration>
<!-- Set these to the correct values from Partner Center -->
<TitleId>7325F784</TitleId>
<MSAAppId>0000000000000000</MSAAppId>
<ShellVisuals DefaultDisplayName="testsprite2"
PublisherDisplayName="SDL"
Square480x480Logo="Logo480x480.png"
Square150x150Logo="Logo150x150.png"
Square44x44Logo="Logo44x44.png"
Description="testsprite2"
ForegroundText="light"
BackgroundColor="#000000"
StoreLogo="Logo100x100.png"/>
</Game>

View File

@ -0,0 +1,9 @@
<Package>
<Chunk Id="1000" Marker="Launch">
<FileGroup DestinationPath="." SourcePath="." Include="testsprite2.exe" />
<FileGroup DestinationPath="." SourcePath="." Include="MicrosoftGame.config" />
<FileGroup DestinationPath="." SourcePath="." Include="*.bmp" />
<FileGroup DestinationPath="." SourcePath="." Include="*.png" />
<FileGroup DestinationPath="." SourcePath="." Include="*.dll" />
</Chunk>
</Package>

View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Gaming.Desktop.x64">
<Configuration>Debug</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Gaming.Desktop.x64">
<Configuration>Release</Configuration>
<Platform>Gaming.Desktop.x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{40FB7794-D3C3-4CFE-BCF4-A80C96635682}</ProjectGuid>
<RootNamespace>testsprite2</RootNamespace>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset Condition="'$(VisualStudioVersion)' != '10.0'">$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC70.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(Platform)\$(Configuration)\</IntDir>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Release/testsprite2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\Debug/testsprite2.tlb</TypeLibraryName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)/../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>%(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<AdditionalDependencies>xgameruntime.lib;../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\..\SDL\SDL.vcxproj">
<Project>{81ce8daf-ebb2-4761-8e45-b71abcca8c68}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLmain\SDLmain.vcxproj">
<Project>{da956fd3-e142-46f2-9dd5-c78bebb56b7a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="..\..\SDLtest\SDLtest.vcxproj">
<Project>{da956fd3-e143-46f2-9fe5-c77bebc56b1a}</Project>
<Private>false</Private>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\icon.bmp">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
copy "%(FullPath)" "$(OutDir)\"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">Copying %(Filename)%(Extension)</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">copy "%(FullPath)" "$(ProjectDir)\"
copy "%(FullPath)" "$(OutDir)\"</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">$(ProjectDir)\%(Filename)%(Extension);%(Outputs)</Outputs>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\test\testsprite2.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="MicrosoftGame.config">
<FileType>Document</FileType>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll">
<FileType>Document</FileType>
</CopyFileToFolders>
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png" />
<CopyFileToFolders Include="..\..\logos\Logo150x150.png" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png" />
<CopyFileToFolders Include="..\..\logos\Logo480x480.png" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="..\..\..\test\testsprite2.c" />
<ClCompile Include="..\..\..\test\testutils.c" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="..\..\..\test\icon.bmp" />
<CopyFileToFolders Include="MicrosoftGame.config" />
<CopyFileToFolders Include="..\..\logos\Logo44x44.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo100x100.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo150x150.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="..\..\logos\Logo480x480.png">
<Filter>logos</Filter>
</CopyFileToFolders>
<CopyFileToFolders Include="$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll" />
<CopyFileToFolders Include="PackageLayout.xml" />
</ItemGroup>
<ItemGroup>
<Filter Include="logos">
<UniqueIdentifier>{c3c871f2-c7b7-4025-8ba4-037dde717fe1}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

154
docs/README-gdk.md Normal file
View File

@ -0,0 +1,154 @@
GDK
=====
This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
At this time, only Windows GDK is supported. Xbox support is slated for the future.
Requirements
------------
* Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested)
* Microsoft GDK June 2022 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/June_2022))
* To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the identifiers used by the GDK test programs in the included solution will work.
Windows GDK Status
------
The Windows GDK port supports the full set of Win32 APIs, renderers, controllers, input devices, etc., as the normal Windows x64 build of SDL.
* Additionally, the GDK port adds the following:
* Compile-time platform detection for SDL programs. The `__GDK__` is `#define`d on every GDK platform, and the `__WINGDK__` is `#define`d on Windows GDK, specifically. (This distinction exists because other GDK platforms support a smaller subset of functionality. This allows you to mark code for "any" GDK separate from Windows GDK.)
* GDK-specific setup:
* Initializing/uninitializing the game runtime, and initializing Xbox Live services
* Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue.
* An implementation on `WinMain` that performs the above GDK setup (you should link against SDL2main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
* What doesn't work:
* Compilation with anything other than through the included Visual C++ solution file
## VisualC-GDK Solution
The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration:
* SDL2 (DLL) - This is the typical SDL2.dll, but for Gaming.Desktop.x64.
* SDL2main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs.
* tests/testgamecontroller - Standard SDL test program demonstrating controller functionality.
* tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live.
*NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this.
* tests/testsprite2 - Standard SDL test program demonstrating sprite drawing functionality.
If you set one of the test programs as a startup project, you can run it directly from Visual Studio.
Windows GDK Setup, Detailed Steps
---------------------
These steps assume you already have a game using SDL that runs on Windows x64 along with a corresponding Visual Studio solution file for the x64 version. If you don't have this, it's easiest to use one of the test program vcxproj files in the `VisualC-GDK` directory as a starting point, though you will still need to do most of the steps below.
### 1. Add a Gaming.Desktop.x64 Configuration ###
In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration.
### 2. Build SDL2 and SDL2main for GDK ###
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL2 and SDL2main targets (Release is recommended). You will need to copy/keep track of the `SDL2.dll`, `SDL2.lib`, and `SDL2main.lib` output files for your game project.
*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built.
### 3. Configuring Project Settings ###
While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration:
* Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL2.lib and SDL2main.lib are
* Under Linker > Input > Additional Dependencies, you need the following:
* `SDL2.lib`
* `SDL2main.lib` (unless not using)
* `xgameruntime.lib`
* `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib`
* Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK.
### 4. Setting up SDL_main ###
Rather than using your own implementation of `WinMain`, it's recommended that you instead `#include "SDL_main.h"` and declare a standard main function. If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
### 5. Required DLLs ###
The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory:
* Your SDL2.dll
* "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll"
You can either copy these in a post-build step, or you can add the dlls into the project and set its Configuration Properties > General > Item type to "Copy file," which will also copy them into the output directory.
### 6. Setting up MicrosoftGame.config ###
You can copy `VisualC-GDK/tests/testgdk/MicrosoftGame.config` and use that as a starting point in your project. Minimally, you will want to change the Executable Name attribute, the DefaultDisplayName, and the Description.
This file must be copied into the same directory as the game's .exe file. As with the DLLs, you can either use a post-build step or the "Copy file" item type.
For basic testing, you do not need to change anything else in `MicrosoftGame.config`. However, if you want to test any Xbox Live services (such as logging in users) _or_ publish a package, you will need to setup a Game app on Partner Center.
Then, you need to set the following values to the values from Partner Center:
* Identity tag - Name and Publisher attributes
* TitleId
* MSAAppId
### 7. Adding Required Logos
Several logo PNG files are required to be able to launch the game, even from the debugger. You can use the sample logos provided in `VisualC-GDK/logos`. As with the other files, they must be copied into the same directory as the game's .exe file.
### 8. Copying any Data Files ###
When debugging GDK games, there is no way to specify a working directory. Therefore, any required game data must also be copied into the output directory, likely in a post-build step.
### 9. Build and Run from Visual Studio ###
At this point, you should be able to build and run your game from the Visual Studio Debugger. If you get any linker errors, make sure you double-check that you referenced all the required libs.
If you are testing Xbox Live functionality, it's likely you will need to change to the Sandbox for your title. To do this:
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
2. Switch the sandbox name with:
`XblPCSandbox SANDBOX.#`
3. (To switch back to the retail sandbox):
`XblPCSandbox RETAIL`
### 10. Packaging and Installing Locally
You can use one of the test program's `PackageLayout.xml` as a starting point. Minimally, you will need to change the exe to the correct name and also reference any required game data. As with the other data files, it's easiest if you have this copy to the output directory, although it's not a requirement as you can specify relative paths to files.
To create the package:
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
2. `cd` to the directory containing the `PackageLayout.xml` with the correct paths (if you use the local path as in the sample package layout, this would be from your .exe output directory)
3. `mkdir Package` to create an output directory
4. To package the file into the `Package` directory, use:
`makepkg pack /f PackageLayout.xml /lt /d . /nogameos /pc /pd Package`
5. To install the package, use:
`wdapp install PACKAGENAME.msixvc`
6. Once the package is installed, you can run it from the start menu.
7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox.
Troubleshooting
---------------
#### Xbox Live Login does not work
As of June 2022 GDK, you must have a valid Title Id and MSAAppId in order to test Xbox Live functionality such as user login. Make sure these are set correctly in the `MicrosoftGame.config`. This means that even testgdk will not let you login without setting these properties to valid values.
Furthermore, confirm that your PC is set to the correct sandbox.
#### "The current user has already installed an unpackaged version of this app. A packaged version cannot replace this." error when installing
Prior to June 2022 GDK, running from the Visual Studio debugger would still locally register the app (and it would appear on the start menu). To fix this, you have to uninstall it (it's simplest to right click on it from the start menu to uninstall it).

View File

@ -34,6 +34,7 @@ More documentation and FAQs are available online at [the wiki](http://wiki.libsd
- [DirectFB](README-directfb.md) - [DirectFB](README-directfb.md)
- [DynAPI](README-dynapi.md) - [DynAPI](README-dynapi.md)
- [Emscripten](README-emscripten.md) - [Emscripten](README-emscripten.md)
- [GDK](README-gdk.md)
- [Gesture](README-gesture.md) - [Gesture](README-gesture.md)
- [Git](README-git.md) - [Git](README-git.md)
- [iOS](README-ios.md) - [iOS](README-ios.md)

View File

@ -33,6 +33,8 @@
#include "SDL_config_windows.h" #include "SDL_config_windows.h"
#elif defined(__WINRT__) #elif defined(__WINRT__)
#include "SDL_config_winrt.h" #include "SDL_config_winrt.h"
#elif defined(__WINGDK__)
#include "SDL_config_wingdk.h"
#elif defined(__MACOSX__) #elif defined(__MACOSX__)
#include "SDL_config_macosx.h" #include "SDL_config_macosx.h"
#elif defined(__IPHONEOS__) #elif defined(__IPHONEOS__)

285
include/SDL_config_wingdk.h Normal file
View File

@ -0,0 +1,285 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 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_config_wingdk_h_
#define SDL_config_wingdk_h_
#define SDL_config_h_
#include "SDL_platform.h"
/* Windows GDK does not need Windows SDK version checks because it requires
* a recent version of the Windows 10 SDK. */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
/* At this time, only recent MSVC or clang are supported by Windows GDK */
#if defined(__clang__)
#define HAVE_STDINT_H 1
#elif defined(_MSC_VER)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#ifndef _UINTPTR_T_DEFINED
typedef unsigned __int64 uintptr_t;
#define _UINTPTR_T_DEFINED
#endif
#else /* !__clang__ && !_MSC_VER */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
#endif
typedef unsigned int uintptr_t;
#endif /* __clang__ || _MSC_VER */
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
/* GDK only supports 64-bit */
# define SIZEOF_VOIDP 8
#ifdef __clang__
# define HAVE_GCC_ATOMICS 1
#endif
#define HAVE_DDRAW_H 1
#define HAVE_DINPUT_H 1
#define HAVE_DSOUND_H 1
/* No SDK version checks needed for these because the SDK has to be new. */
#define HAVE_DXGI_H 1
#define HAVE_XINPUT_H 1
#define HAVE_WINDOWS_GAMING_INPUT_H 1
#define HAVE_D3D11_H 1
#define HAVE_ROAPI_H 1
#define HAVE_D3D12_H 1
#define HAVE_SHELLSCALINGAPI_H 1
#define HAVE_MMDEVICEAPI_H 1
#define HAVE_AUDIOCLIENT_H 1
#define HAVE_TPCSHRD_H 1
#define HAVE_SENSORSAPI_H 1
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
#define HAVE_IMMINTRIN_H 1
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
# if __has_include(<immintrin.h>)
# define HAVE_IMMINTRIN_H 1
# endif
#endif
/* This is disabled by default to avoid C runtime dependencies and manifest requirements */
#ifdef HAVE_LIBC
/* Useful headers */
#define STDC_HEADERS 1
#define HAVE_CTYPE_H 1
#define HAVE_FLOAT_H 1
#define HAVE_LIMITS_H 1
#define HAVE_MATH_H 1
#define HAVE_SIGNAL_H 1
#define HAVE_STDIO_H 1
#define HAVE_STRING_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_QSORT 1
#define HAVE_BSEARCH 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
/* These functions have security warnings, so we won't use them */
/* #undef HAVE__STRUPR */
/* #undef HAVE__STRLWR */
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
/* #undef HAVE_STRTOK_R */
/* These functions have security warnings, so we won't use them */
/* #undef HAVE__LTOA */
/* #undef HAVE__ULTOA */
#define HAVE_STRTOL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE__STRICMP 1
#define HAVE__STRNICMP 1
#define HAVE__WCSICMP 1
#define HAVE__WCSNICMP 1
#define HAVE__WCSDUP 1
#define HAVE_ACOS 1
#define HAVE_ASIN 1
#define HAVE_ATAN 1
#define HAVE_ATAN2 1
#define HAVE_CEIL 1
#define HAVE_COS 1
#define HAVE_EXP 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_FMOD 1
#define HAVE_LOG 1
#define HAVE_LOG10 1
#define HAVE_POW 1
#define HAVE_SIN 1
#define HAVE_SQRT 1
#define HAVE_TAN 1
#define HAVE_ACOSF 1
#define HAVE_ASINF 1
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CEILF 1
#define HAVE__COPYSIGN 1
#define HAVE_COSF 1
#define HAVE_EXPF 1
#define HAVE_FABSF 1
#define HAVE_FLOORF 1
#define HAVE_FMODF 1
#define HAVE_LOGF 1
#define HAVE_LOG10F 1
#define HAVE_POWF 1
#define HAVE_SINF 1
#define HAVE_SQRTF 1
#define HAVE_TANF 1
#if defined(_MSC_VER)
/* These functions were added with the VC++ 2013 C runtime library */
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_VSSCANF 1
#define HAVE_LROUND 1
#define HAVE_LROUNDF 1
#define HAVE_ROUND 1
#define HAVE_ROUNDF 1
#define HAVE_SCALBN 1
#define HAVE_SCALBNF 1
#define HAVE_TRUNC 1
#define HAVE_TRUNCF 1
#define HAVE__FSEEKI64 1
#ifdef _USE_MATH_DEFINES
#define HAVE_M_PI 1
#endif
#else
#define HAVE_M_PI 1
#endif
#else
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#endif
/* Enable various audio drivers */
#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)
#define SDL_AUDIO_DRIVER_WASAPI 1
#endif
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_WINMM 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_DINPUT 1
#define SDL_JOYSTICK_HIDAPI 1
#define SDL_JOYSTICK_RAWINPUT 1
#define SDL_JOYSTICK_VIRTUAL 1
#ifdef HAVE_WINDOWS_GAMING_INPUT_H
#define SDL_JOYSTICK_WGI 1
#endif
#define SDL_JOYSTICK_XINPUT 1
#define SDL_HAPTIC_DINPUT 1
#define SDL_HAPTIC_XINPUT 1
/* Enable the sensor driver */
#ifdef HAVE_SENSORSAPI_H
#define SDL_SENSOR_WINDOWS 1
#else
#define SDL_SENSOR_DUMMY 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_WINDOWS 1
/* Enable various threading systems */
#define SDL_THREAD_GENERIC_COND_SUFFIX 1
#define SDL_THREAD_WINDOWS 1
/* Enable various timer systems */
#define SDL_TIMER_WINDOWS 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_WINDOWS 1
#ifndef SDL_VIDEO_RENDER_D3D
#define SDL_VIDEO_RENDER_D3D 1
#endif
#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
#define SDL_VIDEO_RENDER_D3D11 1
#endif
#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
#define SDL_VIDEO_RENDER_D3D12 1
#endif
/* Enable OpenGL support */
#ifndef SDL_VIDEO_OPENGL
#define SDL_VIDEO_OPENGL 1
#endif
#ifndef SDL_VIDEO_OPENGL_WGL
#define SDL_VIDEO_OPENGL_WGL 1
#endif
#ifndef SDL_VIDEO_RENDER_OGL
#define SDL_VIDEO_RENDER_OGL 1
#endif
#ifndef SDL_VIDEO_RENDER_OGL_ES2
#define SDL_VIDEO_RENDER_OGL_ES2 1
#endif
#ifndef SDL_VIDEO_OPENGL_ES2
#define SDL_VIDEO_OPENGL_ES2 1
#endif
#ifndef SDL_VIDEO_OPENGL_EGL
#define SDL_VIDEO_OPENGL_EGL 1
#endif
/* Enable Vulkan support */
#define SDL_VIDEO_VULKAN 1
/* Enable system power support */
#define SDL_POWER_WINDOWS 1
/* Enable filesystem support */
#define SDL_FILESYSTEM_WINDOWS 1
#endif /* SDL_config_wingdk_h_ */
/* vi: set ts=4 sw=4 expandtab: */

View File

@ -79,7 +79,7 @@ _m_prefetch(void *__P)
#if !defined(SDL_DISABLE_ARM_NEON_H) #if !defined(SDL_DISABLE_ARM_NEON_H)
# if defined(__ARM_NEON) # if defined(__ARM_NEON)
# include <arm_neon.h> # include <arm_neon.h>
# elif defined(__WINDOWS__) || defined(__WINRT__) # elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */ /* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
# if defined(_M_ARM) # if defined(_M_ARM)
# include <armintr.h> # include <armintr.h>

View File

@ -51,6 +51,15 @@
*/ */
#define SDL_MAIN_NEEDED #define SDL_MAIN_NEEDED
#elif defined(__GDK__)
/* On GDK, SDL provides a main function that initializes the game runtime.
Please note that #include'ing SDL_main.h is not enough to get a main()
function working. You must either link against SDL2main or, if not possible,
call the SDL_GDKRunApp function from your entry point.
*/
#define SDL_MAIN_NEEDED
#elif defined(__IPHONEOS__) #elif defined(__IPHONEOS__)
/* On iOS SDL provides a main function that creates an application delegate /* On iOS SDL provides a main function that creates an application delegate
and starts the iOS application run loop. and starts the iOS application run loop.
@ -148,7 +157,7 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
*/ */
extern DECLSPEC void SDLCALL SDL_SetMainReady(void); extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
/** /**
* Register a win32 window class for SDL's use. * Register a win32 window class for SDL's use.
@ -192,7 +201,7 @@ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void
*/ */
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__GDK__) */
#ifdef __WINRT__ #ifdef __WINRT__
@ -227,6 +236,19 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
#endif /* __IPHONEOS__ */ #endif /* __IPHONEOS__ */
#ifdef __GDK__
/**
* Initialize and launch an SDL GDK application.
*
* \param mainFunction the SDL app's C-style main(), an SDL_main_func
* \param reserved reserved for future use; should be NULL
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
* more information on the failure.
*/
extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved);
#endif /* __GDK__ */
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -144,7 +144,7 @@
#endif #endif
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
/* Try to find out if we're compiling for WinRT or non-WinRT */ /* Try to find out if we're compiling for WinRT, GDK or non-WinRT/GDK */
#if defined(_MSC_VER) && defined(__has_include) #if defined(_MSC_VER) && defined(__has_include)
#if __has_include(<winapifamily.h>) #if __has_include(<winapifamily.h>)
#define HAVE_WINAPIFAMILY_H 1 #define HAVE_WINAPIFAMILY_H 1
@ -169,6 +169,9 @@
#if WINAPI_FAMILY_WINRT #if WINAPI_FAMILY_WINRT
#undef __WINRT__ #undef __WINRT__
#define __WINRT__ 1 #define __WINRT__ 1
#elif defined(_GAMING_DESKTOP) /* GDK project configuration always defines _GAMING_XXX */
#undef __WINGDK__
#define __WINGDK__ 1
#else #else
#undef __WINDOWS__ #undef __WINDOWS__
#define __WINDOWS__ 1 #define __WINDOWS__ 1
@ -179,6 +182,11 @@
#undef __WIN32__ #undef __WIN32__
#define __WIN32__ 1 #define __WIN32__ 1
#endif #endif
/* This is to support generic "any GDK" separate from a platform-specific GDK */
#if defined(__WINGDK__) || defined(__XBOXONEGDK__) || defined(__XBOXSERIESGDK__)
#undef __GDK__
#define __GDK__ 1
#endif
#if defined(__PSP__) #if defined(__PSP__)
#undef __PSP__ #undef __PSP__
#define __PSP__ 1 #define __PSP__ 1

View File

@ -98,7 +98,7 @@ typedef struct SDL_RWops
{ {
void *asset; void *asset;
} androidio; } androidio;
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__GDK__)
struct struct
{ {
SDL_bool append; SDL_bool append;

View File

@ -259,7 +259,7 @@ typedef uint64_t Uint64;
#ifndef SDL_PRIs64 #ifndef SDL_PRIs64
#ifdef PRIs64 #ifdef PRIs64
#define SDL_PRIs64 PRIs64 #define SDL_PRIs64 PRIs64
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__GDK__)
#define SDL_PRIs64 "I64d" #define SDL_PRIs64 "I64d"
#elif defined(__LINUX__) && defined(__LP64__) #elif defined(__LINUX__) && defined(__LP64__)
#define SDL_PRIs64 "ld" #define SDL_PRIs64 "ld"
@ -270,7 +270,7 @@ typedef uint64_t Uint64;
#ifndef SDL_PRIu64 #ifndef SDL_PRIu64
#ifdef PRIu64 #ifdef PRIu64
#define SDL_PRIu64 PRIu64 #define SDL_PRIu64 PRIu64
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__GDK__)
#define SDL_PRIu64 "I64u" #define SDL_PRIu64 "I64u"
#elif defined(__LINUX__) && defined(__LP64__) #elif defined(__LINUX__) && defined(__LP64__)
#define SDL_PRIu64 "lu" #define SDL_PRIu64 "lu"
@ -281,7 +281,7 @@ typedef uint64_t Uint64;
#ifndef SDL_PRIx64 #ifndef SDL_PRIx64
#ifdef PRIx64 #ifdef PRIx64
#define SDL_PRIx64 PRIx64 #define SDL_PRIx64 PRIx64
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__GDK__)
#define SDL_PRIx64 "I64x" #define SDL_PRIx64 "I64x"
#elif defined(__LINUX__) && defined(__LP64__) #elif defined(__LINUX__) && defined(__LP64__)
#define SDL_PRIx64 "lx" #define SDL_PRIx64 "lx"
@ -292,7 +292,7 @@ typedef uint64_t Uint64;
#ifndef SDL_PRIX64 #ifndef SDL_PRIX64
#ifdef PRIX64 #ifdef PRIX64
#define SDL_PRIX64 PRIX64 #define SDL_PRIX64 PRIX64
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__GDK__)
#define SDL_PRIX64 "I64X" #define SDL_PRIX64 "I64X"
#elif defined(__LINUX__) && defined(__LP64__) #elif defined(__LINUX__) && defined(__LP64__)
#define SDL_PRIX64 "lX" #define SDL_PRIX64 "lX"

View File

@ -41,7 +41,7 @@ extern "C" {
/* Platform specific functions for Windows */ /* Platform specific functions for Windows */
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam); typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsigned int message, Uint64 wParam, Sint64 lParam);
@ -55,6 +55,10 @@ typedef void (SDLCALL * SDL_WindowsMessageHook)(void *userdata, void *hWnd, unsi
*/ */
extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata); extern DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata);
#endif /* defined(__WIN32__) || defined(__GDK__) */
#if defined(__WIN32__) || defined(__WINGDK__)
/** /**
* Get the D3D9 adapter index that matches the specified display index. * Get the D3D9 adapter index that matches the specified display index.
* *
@ -102,6 +106,10 @@ typedef struct ID3D11Device ID3D11Device;
*/ */
extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer); extern DECLSPEC ID3D11Device* SDLCALL SDL_RenderGetD3D11Device(SDL_Renderer * renderer);
#endif /* defined(__WIN32__) || defined(__WINGDK__) */
#if defined(__WIN32__) || defined(__GDK__)
typedef struct ID3D12Device ID3D12Device; typedef struct ID3D12Device ID3D12Device;
/** /**
@ -118,6 +126,10 @@ typedef struct ID3D12Device ID3D12Device;
*/ */
extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer); extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* renderer);
#endif /* defined(__WIN32__) || defined(__GDK__) */
#if defined(__WIN32__) || defined(__WINGDK__)
/** /**
* Get the DXGI Adapter and Output indices for the specified display index. * Get the DXGI Adapter and Output indices for the specified display index.
* *
@ -138,8 +150,7 @@ extern DECLSPEC ID3D12Device* SDLCALL SDL_RenderGetD3D12Device(SDL_Renderer* ren
*/ */
extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex ); extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex );
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
/* Platform specific functions for Linux */ /* Platform specific functions for Linux */
#ifdef __LINUX__ #ifdef __LINUX__
@ -580,6 +591,25 @@ extern DECLSPEC void SDLCALL SDL_OnApplicationDidBecomeActive(void);
extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void); extern DECLSPEC void SDLCALL SDL_OnApplicationDidChangeStatusBarOrientation(void);
#endif #endif
/* Functions used only by GDK */
#if defined(__GDK__)
typedef struct XTaskQueueObject * XTaskQueueHandle;
/**
* Gets a reference to the global async task queue handle for GDK,
* initializing if needed.
*
* Once you are done with the task queue, you should call XTaskQueueCloseHandle
* to reduce the reference count to avoid a resource leak.
*
* \param outTaskQueue a pointer to be filled in with task queue handle.
* \returns 0 if success, -1 if any error occurs.
*
*/
extern DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue);
#endif
/* Ends C function definitions when using C++ */ /* Ends C function definitions when using C++ */
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -35,7 +35,7 @@
#include "SDL_atomic.h" #include "SDL_atomic.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
#include <process.h> /* _beginthreadex() and _endthreadex() */ #include <process.h> /* _beginthreadex() and _endthreadex() */
#endif #endif
#if defined(__OS2__) /* for _beginthread() and _endthread() */ #if defined(__OS2__) /* for _beginthread() and _endthread() */
@ -88,7 +88,7 @@ typedef enum {
typedef int (SDLCALL * SDL_ThreadFunction) (void *data); typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
/** /**
* \file SDL_thread.h * \file SDL_thread.h
* *

View File

@ -51,7 +51,7 @@
/* Some compilers use a special export keyword */ /* Some compilers use a special export keyword */
#ifndef DECLSPEC #ifndef DECLSPEC
# if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
# ifdef DLL_EXPORT # ifdef DLL_EXPORT
# define DECLSPEC __declspec(dllexport) # define DECLSPEC __declspec(dllexport)
# else # else
@ -74,7 +74,7 @@
/* By default SDL uses the C calling convention */ /* By default SDL uses the C calling convention */
#ifndef SDLCALL #ifndef SDLCALL
#if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) #if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
#define SDLCALL __cdecl #define SDLCALL __cdecl
#elif defined(__OS2__) || defined(__EMX__) #elif defined(__OS2__) || defined(__EMX__)
#define SDLCALL _System #define SDLCALL _System

View File

@ -20,7 +20,7 @@
*/ */
#include "./SDL_internal.h" #include "./SDL_internal.h"
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
#include "core/windows/SDL_windows.h" #include "core/windows/SDL_windows.h"
#elif defined(__OS2__) #elif defined(__OS2__)
#include <stdlib.h> /* _exit() */ #include <stdlib.h> /* _exit() */
@ -89,7 +89,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_PATCHLEVEL_max, SDL_PATCHLEVEL <= 99);
extern SDL_NORETURN void SDL_ExitProcess(int exitcode); extern SDL_NORETURN void SDL_ExitProcess(int exitcode);
SDL_NORETURN void SDL_ExitProcess(int exitcode) SDL_NORETURN void SDL_ExitProcess(int exitcode)
{ {
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
/* "if you do not know the state of all threads in your process, it is /* "if you do not know the state of all threads in your process, it is
better to call TerminateProcess than ExitProcess" better to call TerminateProcess than ExitProcess"
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx */ https://msdn.microsoft.com/en-us/library/windows/desktop/ms682658(v=vs.85).aspx */
@ -579,6 +579,8 @@ SDL_GetPlatform(void)
return "Windows"; return "Windows";
#elif __WINRT__ #elif __WINRT__
return "WinRT"; return "WinRT";
#elif __WINGDK__
return "WinGDK";
#elif __TVOS__ #elif __TVOS__
return "tvOS"; return "tvOS";
#elif __IPHONEOS__ #elif __IPHONEOS__
@ -630,6 +632,6 @@ _DllMainCRTStartup(HANDLE hModule,
} }
#endif /* Building DLL */ #endif /* Building DLL */
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__GDK__) */
/* vi: set sts=4 ts=4 sw=4 expandtab: */ /* vi: set sts=4 ts=4 sw=4 expandtab: */

View File

@ -20,7 +20,7 @@
*/ */
#include "./SDL_internal.h" #include "./SDL_internal.h"
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
#include "core/windows/SDL_windows.h" #include "core/windows/SDL_windows.h"
#endif #endif
@ -32,7 +32,7 @@
#include "SDL_assert_c.h" #include "SDL_assert_c.h"
#include "video/SDL_sysvideo.h" #include "video/SDL_sysvideo.h"
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
#ifndef WS_OVERLAPPEDWINDOW #ifndef WS_OVERLAPPEDWINDOW
#define WS_OVERLAPPEDWINDOW 0 #define WS_OVERLAPPEDWINDOW 0
#endif #endif
@ -90,7 +90,7 @@ static void SDL_AddAssertionToReport(SDL_assert_data *data)
} }
} }
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
#define ENDLINE "\r\n" #define ENDLINE "\r\n"
#else #else
#define ENDLINE "\n" #define ENDLINE "\n"

View File

@ -20,7 +20,7 @@
*/ */
#include "./SDL_internal.h" #include "./SDL_internal.h"
#if defined(__WIN32__) || defined(__WINRT__) #if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)
#include "core/windows/SDL_windows.h" #include "core/windows/SDL_windows.h"
#endif #endif
@ -362,7 +362,7 @@ SDL_LogMessageV(int category, SDL_LogPriority priority, const char *fmt, va_list
} }
} }
#if defined(__WIN32__) && !defined(HAVE_STDIO_H) && !defined(__WINRT__) #if defined(__WIN32__) && !defined(HAVE_STDIO_H) && !defined(__WINRT__) && !defined(__GDK__)
/* Flag tracking the attachment of the console: 0=unattached, 1=attached to a console, 2=attached to a file, -1=error */ /* Flag tracking the attachment of the console: 0=unattached, 1=attached to a console, 2=attached to a file, -1=error */
static int consoleAttached = 0; static int consoleAttached = 0;
@ -374,7 +374,7 @@ static void SDLCALL
SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
const char *message) const char *message)
{ {
#if defined(__WIN32__) || defined(__WINRT__) #if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)
/* Way too many allocations here, urgh */ /* Way too many allocations here, urgh */
/* Note: One can't call SDL_SetError here, since that function itself logs. */ /* Note: One can't call SDL_SetError here, since that function itself logs. */
{ {
@ -383,7 +383,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
LPTSTR tstr; LPTSTR tstr;
SDL_bool isstack; SDL_bool isstack;
#if !defined(HAVE_STDIO_H) && !defined(__WINRT__) #if !defined(HAVE_STDIO_H) && !defined(__WINRT__) && !defined(__GDK__)
BOOL attachResult; BOOL attachResult;
DWORD attachError; DWORD attachError;
DWORD charsWritten; DWORD charsWritten;
@ -422,7 +422,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
} }
} }
} }
#endif /* !defined(HAVE_STDIO_H) && !defined(__WINRT__) */ #endif /* !defined(HAVE_STDIO_H) && !defined(__WINRT__) && !defined(__GDK__) */
length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1 + 1 + 1; length = SDL_strlen(SDL_priority_prefixes[priority]) + 2 + SDL_strlen(message) + 1 + 1 + 1;
output = SDL_small_alloc(char, length, &isstack); output = SDL_small_alloc(char, length, &isstack);
@ -432,7 +432,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
/* Output to debugger */ /* Output to debugger */
OutputDebugString(tstr); OutputDebugString(tstr);
#if !defined(HAVE_STDIO_H) && !defined(__WINRT__) #if !defined(HAVE_STDIO_H) && !defined(__WINRT__) && !defined(__GDK__)
/* Screen output to stderr, if console was attached. */ /* Screen output to stderr, if console was attached. */
if (consoleAttached == 1) { if (consoleAttached == 1) {
if (!WriteConsole(stderrHandle, tstr, (DWORD) SDL_tcslen(tstr), &charsWritten, NULL)) { if (!WriteConsole(stderrHandle, tstr, (DWORD) SDL_tcslen(tstr), &charsWritten, NULL)) {
@ -447,7 +447,7 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority,
OutputDebugString(TEXT("Error calling WriteFile\r\n")); OutputDebugString(TEXT("Error calling WriteFile\r\n"));
} }
} }
#endif /* !defined(HAVE_STDIO_H) && !defined(__WINRT__) */ #endif /* !defined(HAVE_STDIO_H) && !defined(__WINRT__) && !defined(__GDK__) */
SDL_free(tstr); SDL_free(tstr);
SDL_small_free(output, isstack); SDL_small_free(output, isstack);

View File

@ -20,7 +20,7 @@
*/ */
#include "../SDL_internal.h" #include "../SDL_internal.h"
#if defined(__WIN32__) || defined(__WINRT__) #if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)
#include "../core/windows/SDL_windows.h" #include "../core/windows/SDL_windows.h"
#endif #endif

View File

@ -519,7 +519,7 @@ WASAPI_PrepDevice(_THIS, const SDL_bool updatestream)
SDL_assert(client != NULL); SDL_assert(client != NULL);
#ifdef __WINRT__ /* CreateEventEx() arrived in Vista, so we need an #ifdef for XP. */ #if defined(__WINRT__) || defined(__GDK__) /* CreateEventEx() arrived in Vista, so we need an #ifdef for XP. */
this->hidden->event = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS); this->hidden->event = CreateEventEx(NULL, NULL, 0, EVENT_ALL_ACCESS);
#else #else
this->hidden->event = CreateEventW(NULL, 0, 0, NULL); this->hidden->event = CreateEventW(NULL, 0, 0, NULL);

177
src/core/gdk/SDL_gdk.cpp Normal file
View File

@ -0,0 +1,177 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 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"
#include "SDL_system.h"
#include "../windows/SDL_windows.h"
#include "SDL_messagebox.h"
#include "SDL_main.h"
#include <XGameRuntime.h>
#include <xsapi-c/services_c.h>
#include <shellapi.h> /* CommandLineToArgvW() */
static XTaskQueueHandle GDK_GlobalTaskQueue;
extern "C" DECLSPEC int
SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue)
{
/* If this is the first call, first create the global task queue. */
if (!GDK_GlobalTaskQueue) {
HRESULT hr;
hr = XTaskQueueCreate(XTaskQueueDispatchMode::ThreadPool,
XTaskQueueDispatchMode::Manual,
&GDK_GlobalTaskQueue
);
if (FAILED(hr)) {
SDL_SetError("[GDK] Could not create global task queue");
return -1;
}
/* The initial call gets the non-duplicated handle so they can clean it up */
*outTaskQueue = GDK_GlobalTaskQueue;
} else {
/* Duplicate the global task queue handle into outTaskQueue */
if (FAILED(XTaskQueueDuplicateHandle(GDK_GlobalTaskQueue, outTaskQueue))) {
SDL_SetError("[GDK] Unable to acquire global task queue");
return -1;
}
}
return 0;
}
extern "C" void
GDK_DispatchTaskQueue(void)
{
/* If there is no global task queue, don't do anything.
* This gives the option to opt-out for those who want to handle everything themselves.
*/
if (GDK_GlobalTaskQueue) {
/* Dispatch any callbacks which are ready. */
while (XTaskQueueDispatch(GDK_GlobalTaskQueue, XTaskQueuePort::Completion, 0))
;
}
}
/* Pop up an out of memory message, returns to Windows */
extern "C" static BOOL
OutOfMemory(void)
{
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL);
return FALSE;
}
/* Gets the arguments with GetCommandLine, converts them to argc and argv
and calls SDL_main */
extern "C" DECLSPEC int
SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved)
{
LPWSTR *argvw;
char **argv;
int i, argc, result;
HRESULT hr;
XTaskQueueHandle taskQueue;
argvw = CommandLineToArgvW(GetCommandLineW(), &argc);
if (argvw == NULL) {
return OutOfMemory();
}
/* Note that we need to be careful about how we allocate/free memory here.
* If the application calls SDL_SetMemoryFunctions(), we can't rely on
* SDL_free() to use the same allocator after SDL_main() returns.
*/
/* Parse it into argv and argc */
argv = (char **) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv));
if (!argv) {
return OutOfMemory();
}
for (i = 0; i < argc; ++i) {
DWORD len;
char *arg = WIN_StringToUTF8W(argvw[i]);
if (!arg) {
return OutOfMemory();
}
len = (DWORD) SDL_strlen(arg);
argv[i] = (char *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len + 1);
if (!argv[i]) {
return OutOfMemory();
}
SDL_memcpy(argv[i], arg, len);
SDL_free(arg);
}
argv[i] = NULL;
LocalFree(argvw);
hr = XGameRuntimeInitialize();
if (SUCCEEDED(hr) && SDL_GDKGetTaskQueue(&taskQueue) == 0) {
Uint32 titleid = 0;
char scidBuffer[64];
XblInitArgs xblArgs;
XTaskQueueSetCurrentProcessTaskQueue(taskQueue);
/* Try to get the title ID and initialize Xbox Live */
hr = XGameGetXboxTitleId(&titleid);
if (SUCCEEDED(hr)) {
SDL_zero(xblArgs);
xblArgs.queue = taskQueue;
SDL_snprintf(scidBuffer, 64, "00000000-0000-0000-0000-0000%08X", titleid);
xblArgs.scid = scidBuffer;
hr = XblInitialize(&xblArgs);
} else {
SDL_SetError("[GDK] Unable to get titleid. Will not call XblInitialize. Check MicrosoftGame.config!");
}
SDL_SetMainReady();
/* Run the application main() code */
result = mainFunction(argc, argv);
/* !!! FIXME: This follows the docs exactly, but for some reason still leaks handles on exit? */
/* Terminate the task queue and dispatch any pending tasks */
XTaskQueueTerminate(taskQueue, false, nullptr, nullptr);
while (XTaskQueueDispatch(taskQueue, XTaskQueuePort::Completion, 0))
;
XTaskQueueCloseHandle(taskQueue);
XGameRuntimeUninitialize();
} else {
#ifdef __WINGDK__
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "[GDK] Could not initialize - aborting", NULL);
#else
SDL_assert_always(0 && "[GDK] Could not initialize - aborting");
#endif
result = -1;
}
/* Free argv, to avoid memory leak */
for (i = 0; i < argc; ++i) {
HeapFree(GetProcessHeap(), 0, argv[i]);
}
HeapFree(GetProcessHeap(), 0, argv);
return result;
}

24
src/core/gdk/SDL_gdk.h Normal file
View File

@ -0,0 +1,24 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 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 called from WIN_PumpEvents on GDK */
extern void GDK_DispatchTaskQueue(void);

View File

@ -20,7 +20,7 @@
*/ */
#include "../../SDL_internal.h" #include "../../SDL_internal.h"
#if defined(__WIN32__) || defined(__WINRT__) #if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)
#include "SDL_windows.h" #include "SDL_windows.h"
#include "SDL_error.h" #include "SDL_error.h"
@ -338,6 +338,6 @@ WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect)
winrect->bottom = sdlrect->y + sdlrect->h - 1; winrect->bottom = sdlrect->y + sdlrect->h - 1;
} }
#endif /* __WIN32__ || __WINRT__ */ #endif /* defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__) */
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View File

@ -40,6 +40,16 @@
#define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */ #define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */
#endif #endif
#define WINVER _WIN32_WINNT #define WINVER _WIN32_WINNT
#elif defined(__WINGDK__)
#define WIN32_LEAN_AND_MEAN
#define STRICT
#ifndef UNICODE
#define UNICODE 1
#endif
#undef WINVER
#undef _WIN32_WINNT
#define _WIN32_WINNT 0xA00
#define WINVER _WIN32_WINNT
#endif #endif
#include <windows.h> #include <windows.h>

View File

@ -24,7 +24,7 @@
#include "../SDL_internal.h" #include "../SDL_internal.h"
#endif #endif
#if defined(__WIN32__) || defined(__WINRT__) #if defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)
#include "../core/windows/SDL_windows.h" #include "../core/windows/SDL_windows.h"
#endif #endif
#if defined(__OS2__) #if defined(__OS2__)
@ -456,7 +456,7 @@ CPU_haveNEON(void)
query the OS kernel in a platform-specific way. :/ */ query the OS kernel in a platform-specific way. :/ */
#if defined(SDL_CPUINFO_DISABLED) #if defined(SDL_CPUINFO_DISABLED)
return 0; /* disabled */ return 0; /* disabled */
#elif (defined(__WINDOWS__) || defined(__WINRT__)) && (defined(_M_ARM) || defined(_M_ARM64)) #elif (defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)) && (defined(_M_ARM) || defined(_M_ARM64))
/* Visual Studio, for ARM, doesn't define __ARM_ARCH. Handle this first. */ /* Visual Studio, for ARM, doesn't define __ARM_ARCH. Handle this first. */
/* Seems to have been removed */ /* Seems to have been removed */
# if !defined(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE) # if !defined(PF_ARM_NEON_INSTRUCTIONS_AVAILABLE)
@ -671,7 +671,7 @@ SDL_GetCPUCount(void)
sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0); sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0);
} }
#endif #endif
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
if (SDL_CPUCount <= 0) { if (SDL_CPUCount <= 0) {
SYSTEM_INFO info; SYSTEM_INFO info;
GetSystemInfo(&info); GetSystemInfo(&info);
@ -1053,7 +1053,7 @@ SDL_GetSystemRAM(void)
} }
} }
#endif #endif
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
if (SDL_SystemRAM <= 0) { if (SDL_SystemRAM <= 0) {
MEMORYSTATUSEX stat; MEMORYSTATUSEX stat;
stat.dwLength = sizeof(stat); stat.dwLength = sizeof(stat);

View File

@ -849,3 +849,5 @@
++'_SDL_HasLASX'.'SDL2.dll'.'SDL_HasLASX' ++'_SDL_HasLASX'.'SDL2.dll'.'SDL_HasLASX'
++'_SDL_RenderGetD3D12Device'.'SDL2.dll'.'SDL_RenderGetD3D12Device' ++'_SDL_RenderGetD3D12Device'.'SDL2.dll'.'SDL_RenderGetD3D12Device'
++'_SDL_utf8strnlen'.'SDL2.dll'.'SDL_utf8strnlen' ++'_SDL_utf8strnlen'.'SDL2.dll'.'SDL_utf8strnlen'
# ++'_SDL_GDKGetTaskQueue'.'SDL2.dll'.'SDL_GDKGetTaskQueue'
# ++'_SDL_GDKRunApp'.'SDL2.dll'.'SDL_GDKRunApp'

View File

@ -875,3 +875,5 @@
#define SDL_HasLASX SDL_HasLASX_REAL #define SDL_HasLASX SDL_HasLASX_REAL
#define SDL_RenderGetD3D12Device SDL_RenderGetD3D12Device_REAL #define SDL_RenderGetD3D12Device SDL_RenderGetD3D12Device_REAL
#define SDL_utf8strnlen SDL_utf8strnlen_REAL #define SDL_utf8strnlen SDL_utf8strnlen_REAL
#define SDL_GDKGetTaskQueue SDL_GDKGetTaskQueue_REAL
#define SDL_GDKRunApp SDL_GDKRunApp_REAL

View File

@ -48,7 +48,7 @@ SDL_DYNAPI_PROC(int,SDL_snprintf,(SDL_OUT_Z_CAP(b) char *a, size_t b, SDL_PRINTF
#undef SDL_CreateThread #undef SDL_CreateThread
#endif #endif
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c, pfnSDL_CurrentBeginThread d, pfnSDL_CurrentEndThread e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c, pfnSDL_CurrentBeginThread d, pfnSDL_CurrentEndThread e),(a,b,c,d,e),return)
#elif defined(__OS2__) #elif defined(__OS2__)
SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c, pfnSDL_CurrentBeginThread d, pfnSDL_CurrentEndThread e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThread,(SDL_ThreadFunction a, const char *b, void *c, pfnSDL_CurrentBeginThread d, pfnSDL_CurrentEndThread e),(a,b,c,d,e),return)
@ -62,9 +62,12 @@ SDL_DYNAPI_PROC(SDL_RWops*,SDL_RWFromFP,(FILE *a, SDL_bool b),(a,b),return)
SDL_DYNAPI_PROC(SDL_RWops*,SDL_RWFromFP,(void *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(SDL_RWops*,SDL_RWFromFP,(void *a, SDL_bool b),(a,b),return)
#endif #endif
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
SDL_DYNAPI_PROC(int,SDL_RegisterApp,(const char *a, Uint32 b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_RegisterApp,(const char *a, Uint32 b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(void,SDL_UnregisterApp,(void),(),) SDL_DYNAPI_PROC(void,SDL_UnregisterApp,(void),(),)
#endif
#if defined(__WIN32__) || defined(__WINGDK__)
SDL_DYNAPI_PROC(int,SDL_Direct3D9GetAdapterIndex,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_Direct3D9GetAdapterIndex,(int a),(a),return)
SDL_DYNAPI_PROC(IDirect3DDevice9*,SDL_RenderGetD3D9Device,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(IDirect3DDevice9*,SDL_RenderGetD3D9Device,(SDL_Renderer *a),(a),return)
#endif #endif
@ -599,7 +602,7 @@ SDL_DYNAPI_PROC(void,SDL_GL_ResetAttributes,(void),(),)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasAVX,(void),(),return)
SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetDefaultAssertionHandler,(void),(),return) SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetDefaultAssertionHandler,(void),(),return)
SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return) SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return)
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
SDL_DYNAPI_PROC(SDL_bool,SDL_DXGIGetOutputInfo,(int a,int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_DXGIGetOutputInfo,(int a,int *b, int *c),(a,b,c),return)
#endif #endif
SDL_DYNAPI_PROC(SDL_bool,SDL_RenderIsClipEnabled,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_RenderIsClipEnabled,(SDL_Renderer *a),(a),return)
@ -620,7 +623,7 @@ SDL_DYNAPI_PROC(int,SDL_QueueAudio,(SDL_AudioDeviceID a, const void *b, Uint32 c
SDL_DYNAPI_PROC(Uint32,SDL_GetQueuedAudioSize,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetQueuedAudioSize,(SDL_AudioDeviceID a),(a),return)
SDL_DYNAPI_PROC(void,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),) SDL_DYNAPI_PROC(void,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),)
SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return)
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),)
#endif #endif
SDL_DYNAPI_PROC(int,SDL_GetDisplayDPI,(int a, float *b, float *c, float *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_GetDisplayDPI,(int a, float *b, float *c, float *d),(a,b,c,d),return)
@ -744,7 +747,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_HasColorKey,(SDL_Surface *a),(a),return)
#undef SDL_CreateThreadWithStackSize #undef SDL_CreateThreadWithStackSize
#endif #endif
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d, pfnSDL_CurrentBeginThread e, pfnSDL_CurrentEndThread f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d, pfnSDL_CurrentBeginThread e, pfnSDL_CurrentEndThread f),(a,b,c,d,e,f),return)
#elif defined(__OS2__) #elif defined(__OS2__)
SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d, pfnSDL_CurrentBeginThread e, pfnSDL_CurrentEndThread f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadWithStackSize,(SDL_ThreadFunction a, const char *b, const size_t c, void *d, pfnSDL_CurrentBeginThread e, pfnSDL_CurrentEndThread f),(a,b,c,d,e,f),return)
@ -854,7 +857,7 @@ SDL_DYNAPI_PROC(float,SDL_roundf,(float a),(a),return)
SDL_DYNAPI_PROC(long,SDL_lround,(double a),(a),return) SDL_DYNAPI_PROC(long,SDL_lround,(double a),(a),return)
SDL_DYNAPI_PROC(long,SDL_lroundf,(float a),(a),return) SDL_DYNAPI_PROC(long,SDL_lroundf,(float a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SoftStretchLinear,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_SoftStretchLinear,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d),(a,b,c,d),return)
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
SDL_DYNAPI_PROC(ID3D11Device*,SDL_RenderGetD3D11Device,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(ID3D11Device*,SDL_RenderGetD3D11Device,(SDL_Renderer *a),(a),return)
#endif #endif
SDL_DYNAPI_PROC(int,SDL_UpdateNVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(int,SDL_UpdateNVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f),(a,b,c,d,e,f),return)
@ -948,7 +951,12 @@ SDL_DYNAPI_PROC(void,SDL_GUIDToString,(SDL_GUID a, char *b, int c),(a,b,c),)
SDL_DYNAPI_PROC(SDL_GUID,SDL_GUIDFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_GUID,SDL_GUIDFromString,(const char *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasLSX,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasLSX,(void),(),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_HasLASX,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasLASX,(void),(),return)
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
SDL_DYNAPI_PROC(ID3D12Device*,SDL_RenderGetD3D12Device,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(ID3D12Device*,SDL_RenderGetD3D12Device,(SDL_Renderer *a),(a),return)
#endif #endif
SDL_DYNAPI_PROC(size_t,SDL_utf8strnlen,(const char *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(size_t,SDL_utf8strnlen,(const char *a, size_t b),(a,b),return)
#if defined(__GDK__)
SDL_DYNAPI_PROC(int,SDL_GDKGetTaskQueue,(XTaskQueueHandle *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GDKRunApp,(SDL_main_func a, void *b),(a,b),return)
#endif

View File

@ -35,7 +35,7 @@
#include "SDL_syswm.h" #include "SDL_syswm.h"
#undef SDL_PRIs64 #undef SDL_PRIs64
#if defined(__WIN32__) && !defined(__CYGWIN__) #if (defined(__WIN32__) || defined(__GDK__)) && !defined(__CYGWIN__)
#define SDL_PRIs64 "I64d" #define SDL_PRIs64 "I64d"
#else #else
#define SDL_PRIs64 "lld" #define SDL_PRIs64 "lld"

View File

@ -28,7 +28,7 @@
#include "SDL_events_c.h" #include "SDL_events_c.h"
#include "../SDL_hints_c.h" #include "../SDL_hints_c.h"
#include "../video/SDL_sysvideo.h" #include "../video/SDL_sysvideo.h"
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
#include "../core/windows/SDL_windows.h" // For GetDoubleClickTime() #include "../core/windows/SDL_windows.h" // For GetDoubleClickTime()
#endif #endif
#if defined(__OS2__) #if defined(__OS2__)
@ -55,7 +55,7 @@ SDL_MouseDoubleClickTimeChanged(void *userdata, const char *name, const char *ol
if (hint && *hint) { if (hint && *hint) {
mouse->double_click_time = SDL_atoi(hint); mouse->double_click_time = SDL_atoi(hint);
} else { } else {
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
mouse->double_click_time = GetDoubleClickTime(); mouse->double_click_time = GetDoubleClickTime();
#elif defined(__OS2__) #elif defined(__OS2__)
mouse->double_click_time = WinQuerySysValue(HWND_DESKTOP, SV_DBLCLKTIME); mouse->double_click_time = WinQuerySysValue(HWND_DESKTOP, SV_DBLCLKTIME);
@ -1069,7 +1069,7 @@ SDL_CaptureMouse(SDL_bool enabled)
return SDL_Unsupported(); return SDL_Unsupported();
} }
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
/* Windows mouse capture is tied to the current thread, and must be called /* Windows mouse capture is tied to the current thread, and must be called
* from the thread that created the window being captured. Since we update * from the thread that created the window being captured. Since we update
* the mouse capture state from the event processing, any application state * the mouse capture state from the event processing, any application state
@ -1078,7 +1078,7 @@ SDL_CaptureMouse(SDL_bool enabled)
if (!SDL_OnVideoThread()) { if (!SDL_OnVideoThread()) {
return SDL_SetError("SDL_CaptureMouse() must be called on the main thread"); return SDL_SetError("SDL_CaptureMouse() must be called on the main thread");
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
if (enabled && SDL_GetKeyboardFocus() == NULL) { if (enabled && SDL_GetKeyboardFocus() == NULL) {
return SDL_SetError("No window has focus"); return SDL_SetError("No window has focus");

View File

@ -29,7 +29,7 @@
#define MUST_THREAD_EVENTS #define MUST_THREAD_EVENTS
#endif #endif
#ifdef __WIN32__ /* Windows doesn't allow a separate event thread */ #if defined(__WIN32__) || defined(__GDK__) /* Windows doesn't allow a separate event thread */
#define CANT_THREAD_EVENTS #define CANT_THREAD_EVENTS
#endif #endif

View File

@ -30,7 +30,7 @@
#include "../SDL_internal.h" #include "../SDL_internal.h"
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
#include "../core/windows/SDL_windows.h" #include "../core/windows/SDL_windows.h"
#endif #endif
@ -62,7 +62,7 @@
#include "nacl_io/nacl_io.h" #include "nacl_io/nacl_io.h"
#endif #endif
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
/* Functions to read/write Win32 API file pointers */ /* Functions to read/write Win32 API file pointers */
@ -303,7 +303,7 @@ windows_file_close(SDL_RWops * context)
} }
return 0; return 0;
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__GDK__) */
#ifdef HAVE_STDIO_H #ifdef HAVE_STDIO_H
@ -574,7 +574,7 @@ SDL_RWFromFile(const char *file, const char *mode)
rwops->close = Android_JNI_FileClose; rwops->close = Android_JNI_FileClose;
rwops->type = SDL_RWOPS_JNIFILE; rwops->type = SDL_RWOPS_JNIFILE;
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__GDK__)
rwops = SDL_AllocRW(); rwops = SDL_AllocRW();
if (!rwops) if (!rwops)
return NULL; /* SDL_SetError already setup by SDL_AllocRW() */ return NULL; /* SDL_SetError already setup by SDL_AllocRW() */

View File

@ -37,7 +37,7 @@
#if !SDL_HIDAPI_DISABLED #if !SDL_HIDAPI_DISABLED
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WINGDK__)
#include "../core/windows/SDL_windows.h" #include "../core/windows/SDL_windows.h"
#endif #endif
@ -89,7 +89,7 @@ static struct
SDL_bool m_bCanGetNotifications; SDL_bool m_bCanGetNotifications;
Uint32 m_unLastDetect; Uint32 m_unLastDetect;
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WINGDK__)
SDL_threadID m_nThreadID; SDL_threadID m_nThreadID;
WNDCLASSEXA m_wndClass; WNDCLASSEXA m_wndClass;
HWND m_hwndMsg; HWND m_hwndMsg;
@ -110,7 +110,7 @@ static struct
} SDL_HIDAPI_discovery; } SDL_HIDAPI_discovery;
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
struct _DEV_BROADCAST_HDR struct _DEV_BROADCAST_HDR
{ {
DWORD dbch_size; DWORD dbch_size;
@ -156,7 +156,7 @@ static LRESULT CALLBACK ControllerWndProc(HWND hwnd, UINT message, WPARAM wParam
return DefWindowProc(hwnd, message, wParam, lParam); return DefWindowProc(hwnd, message, wParam, lParam);
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
#if defined(__MACOSX__) #if defined(__MACOSX__)
@ -219,7 +219,7 @@ HIDAPI_InitializeDiscovery()
SDL_HIDAPI_discovery.m_bCanGetNotifications = SDL_FALSE; SDL_HIDAPI_discovery.m_bCanGetNotifications = SDL_FALSE;
SDL_HIDAPI_discovery.m_unLastDetect = 0; SDL_HIDAPI_discovery.m_unLastDetect = 0;
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WINGDK__)
SDL_HIDAPI_discovery.m_nThreadID = SDL_ThreadID(); SDL_HIDAPI_discovery.m_nThreadID = SDL_ThreadID();
SDL_zero(SDL_HIDAPI_discovery.m_wndClass); SDL_zero(SDL_HIDAPI_discovery.m_wndClass);
@ -246,7 +246,7 @@ HIDAPI_InitializeDiscovery()
SDL_HIDAPI_discovery.m_hNotify = RegisterDeviceNotification( SDL_HIDAPI_discovery.m_hwndMsg, &devBroadcast, DEVICE_NOTIFY_WINDOW_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES ); SDL_HIDAPI_discovery.m_hNotify = RegisterDeviceNotification( SDL_HIDAPI_discovery.m_hwndMsg, &devBroadcast, DEVICE_NOTIFY_WINDOW_HANDLE | DEVICE_NOTIFY_ALL_INTERFACE_CLASSES );
SDL_HIDAPI_discovery.m_bCanGetNotifications = ( SDL_HIDAPI_discovery.m_hNotify != 0 ); SDL_HIDAPI_discovery.m_bCanGetNotifications = ( SDL_HIDAPI_discovery.m_hNotify != 0 );
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
#if defined(__MACOSX__) #if defined(__MACOSX__)
SDL_HIDAPI_discovery.m_notificationPort = IONotificationPortCreate(kIOMasterPortDefault); SDL_HIDAPI_discovery.m_notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
@ -369,7 +369,7 @@ HIDAPI_UpdateDiscovery()
return; return;
} }
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WINGDK__)
#if 0 /* just let the usual SDL_PumpEvents loop dispatch these, fixing bug 4286. --ryan. */ #if 0 /* just let the usual SDL_PumpEvents loop dispatch these, fixing bug 4286. --ryan. */
/* We'll only get messages on the same thread that created the window */ /* We'll only get messages on the same thread that created the window */
if (SDL_ThreadID() == SDL_HIDAPI_discovery.m_nThreadID) { if (SDL_ThreadID() == SDL_HIDAPI_discovery.m_nThreadID) {
@ -382,7 +382,7 @@ HIDAPI_UpdateDiscovery()
} }
} }
#endif #endif
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
#if defined(__MACOSX__) #if defined(__MACOSX__)
if (SDL_HIDAPI_discovery.m_notificationPort) { if (SDL_HIDAPI_discovery.m_notificationPort) {
@ -474,7 +474,7 @@ HIDAPI_ShutdownDiscovery()
return; return;
} }
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WINGDK__)
if (SDL_HIDAPI_discovery.m_hNotify) if (SDL_HIDAPI_discovery.m_hNotify)
UnregisterDeviceNotification(SDL_HIDAPI_discovery.m_hNotify); UnregisterDeviceNotification(SDL_HIDAPI_discovery.m_hNotify);
@ -578,7 +578,7 @@ static const SDL_UDEV_Symbols *udev_ctx = NULL;
#include "mac/hid.c" #include "mac/hid.c"
#define HAVE_PLATFORM_BACKEND 1 #define HAVE_PLATFORM_BACKEND 1
#define udev_ctx 1 #define udev_ctx 1
#elif __WINDOWS__ #elif __WINDOWS__ || __WINGDK__
#include "windows/hid.c" #include "windows/hid.c"
#define HAVE_PLATFORM_BACKEND 1 #define HAVE_PLATFORM_BACKEND 1
#define udev_ctx 1 #define udev_ctx 1

View File

@ -1019,7 +1019,7 @@ static char *SDL_PrivateGetControllerGUIDFromMappingString(const char *pMapping)
pchGUID[pFirstComma - pMapping] = '\0'; pchGUID[pFirstComma - pMapping] = '\0';
/* Convert old style GUIDs to the new style in 2.0.5 */ /* Convert old style GUIDs to the new style in 2.0.5 */
#if __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
if (SDL_strlen(pchGUID) == 32 && if (SDL_strlen(pchGUID) == 32 &&
SDL_memcmp(&pchGUID[20], "504944564944", 12) == 0) { SDL_memcmp(&pchGUID[20], "504944564944", 12) == 0) {
SDL_memcpy(&pchGUID[20], "000000000000", 12); SDL_memcpy(&pchGUID[20], "000000000000", 12);

View File

@ -37,7 +37,7 @@
/* This is included in only one place because it has a large static list of controllers */ /* This is included in only one place because it has a large static list of controllers */
#include "controller_type.h" #include "controller_type.h"
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
/* Needed for checking for input remapping programs */ /* Needed for checking for input remapping programs */
#include "../core/windows/SDL_windows.h" #include "../core/windows/SDL_windows.h"
@ -2362,7 +2362,7 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid)
static SDL_bool SDL_IsPS4RemapperRunning(void) static SDL_bool SDL_IsPS4RemapperRunning(void)
{ {
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
const char *mapper_processes[] = { const char *mapper_processes[] = {
"DS4Windows.exe", "DS4Windows.exe",
"InputMapper.exe", "InputMapper.exe",

View File

@ -156,7 +156,7 @@ SetInitState(SDL_DriverXboxOne_Context *ctx, SDL_XboxOneInitState state)
static void static void
SendAckIfNeeded(SDL_HIDAPI_Device *device, Uint8 *data, int size) SendAckIfNeeded(SDL_HIDAPI_Device *device, Uint8 *data, int size)
{ {
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
/* The Windows driver is taking care of acks */ /* The Windows driver is taking care of acks */
#else #else
if ((data[1] & 0x30) == 0x30) { if ((data[1] & 0x30) == 0x30) {
@ -179,7 +179,7 @@ SendAckIfNeeded(SDL_HIDAPI_Device *device, Uint8 *data, int size)
SDL_SetError("Couldn't send ack packet"); SDL_SetError("Couldn't send ack packet");
} }
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__ */
} }
#if 0 #if 0
@ -912,7 +912,7 @@ HIDAPI_DriverXboxOne_UpdateInitState(SDL_HIDAPI_Device *device, SDL_DriverXboxOn
switch (ctx->init_state) { switch (ctx->init_state) {
case XBOX_ONE_INIT_STATE_START_NEGOTIATING: case XBOX_ONE_INIT_STATE_START_NEGOTIATING:
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
/* The Windows driver is taking care of negotiation */ /* The Windows driver is taking care of negotiation */
SetInitState(ctx, XBOX_ONE_INIT_STATE_COMPLETE); SetInitState(ctx, XBOX_ONE_INIT_STATE_COMPLETE);
#else #else

View File

@ -32,7 +32,7 @@
#include "SDL_hidapi_rumble.h" #include "SDL_hidapi_rumble.h"
#include "../../SDL_hints_c.h" #include "../../SDL_hints_c.h"
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WINGDK__)
#include "../windows/SDL_rawinputjoystick_c.h" #include "../windows/SDL_rawinputjoystick_c.h"
#endif #endif

View File

@ -0,0 +1,41 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 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_config.h"
/* Include this so we define UNICODE properly */
#include "../../core/windows/SDL_windows.h"
/* Include the SDL main definition header */
#include "SDL.h"
#include "SDL_main.h"
#ifdef main
# undef main
#endif /* main */
/* This is where execution begins */
int WINAPI
WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
{
return SDL_GDKRunApp(SDL_main, NULL);
}
/* vi: set ts=4 sw=4 expandtab: */

View File

@ -1775,7 +1775,7 @@ SDL_RenderDriver D3D_RenderDriver = {
}; };
#endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */ #endif /* SDL_VIDEO_RENDER_D3D && !SDL_RENDER_DISABLED */
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
/* This function needs to always exist on Windows, for the Dynamic API. */ /* This function needs to always exist on Windows, for the Dynamic API. */
IDirect3DDevice9 * IDirect3DDevice9 *
SDL_RenderGetD3D9Device(SDL_Renderer * renderer) SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
@ -1799,6 +1799,6 @@ SDL_RenderGetD3D9Device(SDL_Renderer * renderer)
return device; return device;
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View File

@ -672,7 +672,7 @@ done:
return result; return result;
} }
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
static DXGI_MODE_ROTATION static DXGI_MODE_ROTATION
D3D11_GetCurrentRotation() D3D11_GetCurrentRotation()
@ -681,7 +681,7 @@ D3D11_GetCurrentRotation()
return DXGI_MODE_ROTATION_IDENTITY; return DXGI_MODE_ROTATION_IDENTITY;
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
static BOOL static BOOL
D3D11_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation) D3D11_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation)
@ -827,7 +827,7 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h)
goto done; goto done;
#endif #endif
} else { } else {
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
SDL_SysWMinfo windowinfo; SDL_SysWMinfo windowinfo;
SDL_VERSION(&windowinfo.version); SDL_VERSION(&windowinfo.version);
SDL_GetWindowWMInfo(renderer->window, &windowinfo); SDL_GetWindowWMInfo(renderer->window, &windowinfo);
@ -849,7 +849,7 @@ D3D11_CreateSwapChain(SDL_Renderer * renderer, int w, int h)
#else #else
SDL_SetError(__FUNCTION__", Unable to find something to attach a swap chain to"); SDL_SetError(__FUNCTION__", Unable to find something to attach a swap chain to");
goto done; goto done;
#endif /* ifdef __WIN32__ / else */ #endif /* defined(__WIN32__) || defined(__WINGDK__) / else */
} }
data->swapEffect = swapChainDesc.SwapEffect; data->swapEffect = swapChainDesc.SwapEffect;
@ -2473,7 +2473,7 @@ SDL_RenderDriver D3D11_RenderDriver = {
#endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */ #endif /* SDL_VIDEO_RENDER_D3D11 && !SDL_RENDER_DISABLED */
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__WINGDK__)
/* This function needs to always exist on Windows, for the Dynamic API. */ /* This function needs to always exist on Windows, for the Dynamic API. */
ID3D11Device * ID3D11Device *
SDL_RenderGetD3D11Device(SDL_Renderer * renderer) SDL_RenderGetD3D11Device(SDL_Renderer * renderer)
@ -2497,6 +2497,6 @@ SDL_RenderGetD3D11Device(SDL_Renderer * renderer)
return device; return device;
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__WINGDK__) */
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View File

@ -3042,7 +3042,7 @@ SDL_RenderDriver D3D12_RenderDriver = {
#endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED */ #endif /* SDL_VIDEO_RENDER_D3D12 && !SDL_RENDER_DISABLED */
#ifdef __WIN32__ #if defined(__WIN32__) || defined(__GDK__)
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
@ -3069,6 +3069,6 @@ SDL_RenderGetD3D12Device(SDL_Renderer * renderer)
return device; return device;
} }
#endif /* __WIN32__ */ #endif /* defined(__WIN32__) || defined(__GDK__) */
/* vi: set ts=4 sw=4 expandtab: */ /* vi: set ts=4 sw=4 expandtab: */

View File

@ -1715,7 +1715,7 @@ GL_IsProbablyAccelerated(const GL_RenderData *data)
/*const char *vendor = (const char *) data->glGetString(GL_VENDOR);*/ /*const char *vendor = (const char *) data->glGetString(GL_VENDOR);*/
const char *renderer = (const char *) data->glGetString(GL_RENDERER); const char *renderer = (const char *) data->glGetString(GL_RENDERER);
#ifdef __WINDOWS__ #if defined(__WINDOWS__) || defined(__WINGDK__)
if (SDL_strcmp(renderer, "GDI Generic") == 0) { if (SDL_strcmp(renderer, "GDI Generic") == 0) {
return SDL_FALSE; /* Microsoft's fallback software renderer. Fix your system! */ return SDL_FALSE; /* Microsoft's fallback software renderer. Fix your system! */
} }

View File

@ -32,7 +32,7 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED #if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__GDK__)
#include "../../core/windows/SDL_windows.h" #include "../../core/windows/SDL_windows.h"
#endif #endif

View File

@ -25,7 +25,7 @@
#include "../SDL_internal.h" #include "../SDL_internal.h"
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WINGDK__)
#include "../core/windows/SDL_windows.h" #include "../core/windows/SDL_windows.h"
#endif #endif
@ -35,7 +35,7 @@
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
#if defined(__WIN32__) && (!defined(HAVE_SETENV) || !defined(HAVE_GETENV)) #if (defined(__WIN32__) || defined(__WINGDK__)) && (!defined(HAVE_SETENV) || !defined(HAVE_GETENV))
/* Note this isn't thread-safe! */ /* Note this isn't thread-safe! */
static char *SDL_envmem = NULL; /* Ugh, memory leak */ static char *SDL_envmem = NULL; /* Ugh, memory leak */
static size_t SDL_envmemlen = 0; static size_t SDL_envmemlen = 0;
@ -54,7 +54,7 @@ SDL_setenv(const char *name, const char *value, int overwrite)
return setenv(name, value, overwrite); return setenv(name, value, overwrite);
} }
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__WINGDK__)
int int
SDL_setenv(const char *name, const char *value, int overwrite) SDL_setenv(const char *name, const char *value, int overwrite)
{ {
@ -187,7 +187,7 @@ SDL_getenv(const char *name)
return getenv(name); return getenv(name);
} }
#elif defined(__WIN32__) #elif defined(__WIN32__) || defined(__WINGDK__)
char * char *
SDL_getenv(const char *name) SDL_getenv(const char *name)
{ {

View File

@ -131,7 +131,7 @@ static struct
{ "US-ASCII", ENCODING_ASCII }, { "US-ASCII", ENCODING_ASCII },
{ "8859-1", ENCODING_LATIN1 }, { "8859-1", ENCODING_LATIN1 },
{ "ISO-8859-1", ENCODING_LATIN1 }, { "ISO-8859-1", ENCODING_LATIN1 },
#if defined(__WIN32__) || defined(__OS2__) #if defined(__WIN32__) || defined(__OS2__) || defined(__GDK__)
{ "WCHAR_T", ENCODING_UTF16LE }, { "WCHAR_T", ENCODING_UTF16LE },
#else #else
{ "WCHAR_T", ENCODING_UCS4NATIVE }, { "WCHAR_T", ENCODING_UCS4NATIVE },

View File

@ -1667,7 +1667,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
/* Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation, /* Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
* but it's important or window focus will get broken on windows! * but it's important or window focus will get broken on windows!
*/ */
#if !defined(__WIN32__) #if !defined(__WIN32__) && !defined(__GDK__)
if (window->flags & SDL_WINDOW_MINIMIZED) { if (window->flags & SDL_WINDOW_MINIMIZED) {
window->flags &= ~SDL_WINDOW_MINIMIZED; window->flags &= ~SDL_WINDOW_MINIMIZED;
} }
@ -2534,7 +2534,7 @@ SDL_CreateWindowFramebuffer(SDL_Window * window)
attempt_texture_framebuffer = SDL_FALSE; attempt_texture_framebuffer = SDL_FALSE;
} }
#if defined(__WIN32__) /* GDI BitBlt() is way faster than Direct3D dynamic textures right now. (!!! FIXME: is this still true?) */ #if defined(__WIN32__) || defined(__WINGDK__) /* GDI BitBlt() is way faster than Direct3D dynamic textures right now. (!!! FIXME: is this still true?) */
else if ((_this->CreateWindowFramebuffer != NULL) && (SDL_strcmp(_this->name, "windows") == 0)) { else if ((_this->CreateWindowFramebuffer != NULL) && (SDL_strcmp(_this->name, "windows") == 0)) {
attempt_texture_framebuffer = SDL_FALSE; attempt_texture_framebuffer = SDL_FALSE;
} }

View File

@ -53,6 +53,10 @@
#include "wmmsg.h" #include "wmmsg.h"
#endif #endif
#ifdef __GDK__
#include "../../core/gdk/SDL_gdk.h"
#endif
/* #define HIGHDPI_DEBUG */ /* #define HIGHDPI_DEBUG */
/* Masks for processing the windows KEYDOWN and KEYUP messages */ /* Masks for processing the windows KEYDOWN and KEYUP messages */
@ -1803,6 +1807,10 @@ WIN_PumpEvents(_THIS)
/* Update mouse capture */ /* Update mouse capture */
WIN_UpdateMouseCapture(); WIN_UpdateMouseCapture();
#ifdef __GDK__
GDK_DispatchTaskQueue();
#endif
} }

View File

@ -56,7 +56,12 @@ quit(int rc)
SDL_free(positions); SDL_free(positions);
SDL_free(velocities); SDL_free(velocities);
SDLTest_CommonQuit(state); SDLTest_CommonQuit(state);
/* If rc is 0, just let main return normally rather than calling exit.
* This allows testing of platforms where SDL_main is required and does meaningful cleanup.
*/
if (rc != 0) {
exit(rc); exit(rc);
}
} }
int int