Fixed various build and runtime errors when using WinRT with VS2012.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
diff --git a/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj b/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj
index 4eaeca3..12c724d 100644
--- a/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj
+++ b/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj
@@ -62,7 +62,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
- <PreprocessorDefinitions>_USRDLL;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_USRDLL;UNICODE;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
@@ -75,12 +75,12 @@
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
- <PreprocessorDefinitions>_USRDLL;UNICODE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_USRDLL;UNICODE;SDL_BUILDING_WINRT=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
@@ -92,12 +92,12 @@
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
- <PreprocessorDefinitions>_USRDLL;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_USRDLL;UNICODE;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
@@ -110,12 +110,12 @@
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
- <PreprocessorDefinitions>_USRDLL;UNICODE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_USRDLL;UNICODE;SDL_BUILDING_WINRT=1;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAsWinRT>false</CompileAsWinRT>
@@ -127,7 +127,7 @@
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>DXGI.lib;d3d11.lib;xaudio2.lib;WindowsPhoneCore.lib;RuntimeObject.lib;PhoneAppModelHost.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
@@ -201,6 +201,9 @@
<ClInclude Include="..\..\src\core\winrt\SDL_winrtapp_common.h" />
<ClInclude Include="..\..\src\core\winrt\SDL_winrtapp_direct3d.h" />
<ClInclude Include="..\..\src\core\winrt\SDL_winrtapp_xaml.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\SDL_clipboardevents_c.h" />
@@ -215,7 +218,9 @@
<ClInclude Include="..\..\src\haptic\SDL_syshaptic.h" />
<ClInclude Include="..\..\src\joystick\SDL_joystick_c.h" />
<ClInclude Include="..\..\src\joystick\SDL_sysjoystick.h" />
+ <ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers_cpp.h" />
<ClInclude Include="..\..\src\render\mmx.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" />
@@ -289,6 +294,7 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
</ClCompile>
<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_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
@@ -311,12 +317,16 @@
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c" />
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
- <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.cpp">
+ <ClCompile Include="..\..\src\power\SDL_power.c" />
+ <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp" />
+ <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
+ <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
</ClCompile>
+ <ClCompile Include="..\..\src\render\SDL_d3dmath.c" />
<ClCompile Include="..\..\src\render\SDL_render.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_mmx.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
diff --git a/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj.filters b/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj.filters
index 9535fe7..4c8d7d4 100644
--- a/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj.filters
+++ b/VisualC-WinPhone/SDL/SDL-WinPhone_VS2012.vcxproj.filters
@@ -339,6 +339,21 @@
<ClInclude Include="..\..\include\SDL_filesystem.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers_cpp.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\render\SDL_d3dmath.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\dynapi\SDL_dynapi.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\atomic\SDL_atomic.c">
@@ -572,9 +587,6 @@
<ClCompile Include="..\..\src\video\SDL_video.c">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="..\..\src\joystick\SDL_gamecontroller.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -608,5 +620,23 @@
<ClCompile Include="..\..\src\filesystem\winrt\SDL_sysfilesystem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\render\SDL_d3dmath.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\dynapi\SDL_dynapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\power\SDL_power.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
diff --git a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj
index cc5fddd..c864a97 100644
--- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj
+++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj
@@ -72,6 +72,7 @@
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
</ClCompile>
<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_dropevents.c" />
<ClCompile Include="..\..\src\events\SDL_events.c" />
@@ -96,6 +97,8 @@
<ClCompile Include="..\..\src\joystick\SDL_joystick.c" />
<ClCompile Include="..\..\src\joystick\winrt\SDL_xinputjoystick.c" />
<ClCompile Include="..\..\src\loadso\windows\SDL_sysloadso.c" />
+ <ClCompile Include="..\..\src\power\SDL_power.c" />
+ <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11.c" />
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
<CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
@@ -107,6 +110,7 @@
</ClCompile>
<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_mmx.c" />
<ClCompile Include="..\..\src\render\SDL_yuv_sw.c" />
@@ -270,6 +274,9 @@
<ClInclude Include="..\..\src\core\winrt\SDL_winrtapp_common.h" />
<ClInclude Include="..\..\src\core\winrt\SDL_winrtapp_direct3d.h" />
<ClInclude Include="..\..\src\core\winrt\SDL_winrtapp_xaml.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\SDL_clipboardevents_c.h" />
@@ -289,6 +296,7 @@
<ClInclude Include="..\..\src\render\mmx.h" />
<ClInclude Include="..\..\src\render\opengles2\SDL_gles2funcs.h" />
<ClInclude Include="..\..\src\render\opengles2\SDL_shaders_gles2.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" />
@@ -426,7 +434,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -440,7 +448,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -454,7 +462,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -468,7 +476,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -482,7 +490,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -496,7 +504,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<CompileAsWinRT>false</CompileAsWinRT>
<AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_WINDLL;_CRT_SECURE_NO_WARNINGS;SDL_BUILDING_WINRT=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
diff --git a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters
index fb3195f..108cc86 100644
--- a/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters
+++ b/VisualC-WinRT/SDL/SDL-WinRT_VS2012.vcxproj.filters
@@ -283,6 +283,18 @@
<ClCompile Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\render\SDL_d3dmath.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\dynapi\SDL_dynapi.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\power\winrt\SDL_syspower.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\src\power\SDL_power.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\include\begin_code.h">
@@ -642,6 +654,18 @@
<ClInclude Include="..\..\src\render\direct3d11\SDL_render_d3d11_winrthelpers_cpp.h">
<Filter>Source Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\render\SDL_d3dmath.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\dynapi\SDL_dynapi.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\dynapi\SDL_dynapi_overrides.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\src\dynapi\SDL_dynapi_procs.h">
+ <Filter>Source Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">
diff --git a/include/SDL_config_winrt.h b/include/SDL_config_winrt.h
index 2d92581..78b43ab 100644
--- a/include/SDL_config_winrt.h
+++ b/include/SDL_config_winrt.h
@@ -180,8 +180,7 @@ typedef unsigned int uintptr_t;
#endif
/* Enable system power support */
-// TODO, WinRT: investigate system power support. The Win32-based APIs don't work on WinRT.
-#define SDL_POWER_DISABLED 1
+#define SDL_POWER_WINRT 1
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
diff --git a/src/core/winrt/SDL_winrtapp_xaml.cpp b/src/core/winrt/SDL_winrtapp_xaml.cpp
index 67a5cdd..7fe3b82 100644
--- a/src/core/winrt/SDL_winrtapp_xaml.cpp
+++ b/src/core/winrt/SDL_winrtapp_xaml.cpp
@@ -42,7 +42,7 @@
SDL_bool WINRT_XAMLWasEnabled = SDL_FALSE;
#if WINAPI_FAMILY == WINAPI_FAMILY_APP
-ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL;
+extern "C" ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL;
static Windows::Foundation::EventRegistrationToken WINRT_XAMLAppEventToken;
#endif
diff --git a/src/dynapi/SDL_dynapi.h b/src/dynapi/SDL_dynapi.h
index 3752de1..d318552 100644
--- a/src/dynapi/SDL_dynapi.h
+++ b/src/dynapi/SDL_dynapi.h
@@ -45,6 +45,8 @@
#if TARGET_OS_IPHONE /* probably not useful on iOS. */
#define SDL_DYNAMIC_API 0
+#elif SDL_BUILDING_WINRT /* probaly not useful on WinRT, given current .dll loading restrictions */
+#define SDL_DYNAMIC_API 0
#else /* everyone else. */
#define SDL_DYNAMIC_API 1
#endif
diff --git a/src/power/SDL_power.c b/src/power/SDL_power.c
index 0e30f90..10f8355 100644
--- a/src/power/SDL_power.c
+++ b/src/power/SDL_power.c
@@ -37,6 +37,7 @@ SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *, int *, int *);
SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *, int *, int *);
+SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState *, int *, int *);
#ifndef SDL_POWER_DISABLED
#ifdef SDL_POWER_HARDWIRED
@@ -77,6 +78,9 @@ static SDL_GetPowerInfo_Impl implementations[] = {
#ifdef SDL_POWER_PSP /* handles PSP. */
SDL_GetPowerInfo_PSP,
#endif
+#ifdef SDL_POWER_WINRT /* handles WinRT */
+ SDL_GetPowerInfo_WinRT,
+#endif
#ifdef SDL_POWER_HARDWIRED
SDL_GetPowerInfo_Hardwired,
diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c
index 58673d4..2f683b2 100644
--- a/src/render/direct3d11/SDL_render_d3d11.c
+++ b/src/render/direct3d11/SDL_render_d3d11.c
@@ -961,11 +961,10 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer)
D3D11_SAMPLER_DESC samplerDesc;
D3D11_RASTERIZER_DESC rasterDesc;
- // TODO, WinRT, Mar 11, 2014: once SDL/WinRT is back up and running, see if D3D11 init functions are loadable (via LoadPackagedLibrary/SDL_LoadObject, etc.)
-//#ifdef __WINRT__
-// CreateDXGIFactoryFunc = CreateDXGIFactory;
-// D3D11CreateDeviceFunc = D3D11CreateDevice;
-//#else
+#ifdef __WINRT__
+ CreateDXGIFactoryFunc = CreateDXGIFactory1;
+ D3D11CreateDeviceFunc = D3D11CreateDevice;
+#else
data->hDXGIMod = SDL_LoadObject("dxgi.dll");
if (!data->hDXGIMod) {
result = E_FAIL;
@@ -989,7 +988,7 @@ D3D11_CreateDeviceResources(SDL_Renderer * renderer)
result = E_FAIL;
goto done;
}
-//#endif /* __WINRT__ */
+#endif /* __WINRT__ */
result = CreateDXGIFactoryFunc(&IID_IDXGIFactory2, &data->dxgiFactory);
if (FAILED(result)) {
@@ -2833,6 +2832,11 @@ D3D11_RenderPresent(SDL_Renderer * renderer)
HRESULT result;
DXGI_PRESENT_PARAMETERS parameters;
+#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
+ syncInterval = 1;
+ presentFlags = 0;
+ result = IDXGISwapChain_Present(data->swapChain, syncInterval, presentFlags);
+#else
if (renderer->info.flags & SDL_RENDERER_PRESENTVSYNC) {
syncInterval = 1;
presentFlags = 0;
@@ -2841,9 +2845,6 @@ D3D11_RenderPresent(SDL_Renderer * renderer)
presentFlags = DXGI_PRESENT_DO_NOT_WAIT;
}
-#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
- result = IDXGISwapChain_Present(data->swapChain, syncInterval, presentFlags);
-#else
/* The application may optionally specify "dirty" or "scroll"
* rects to improve efficiency in certain scenarios.
* This option is not available on Windows Phone 8, to note.
diff --git a/src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp b/src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp
index 25e6765..78d9912 100644
--- a/src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp
+++ b/src/render/direct3d11/SDL_render_d3d11_winrthelpers.cpp
@@ -37,6 +37,8 @@ extern "C" {
using namespace Windows::UI::Core;
using namespace Windows::Graphics::Display;
+#include <DXGI.h>
+
extern "C" void *
D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer * renderer)
diff --git a/src/thread/stdcpp/SDL_sysmutex.cpp b/src/thread/stdcpp/SDL_sysmutex.cpp
index ac32503..c652aab 100644
--- a/src/thread/stdcpp/SDL_sysmutex.cpp
+++ b/src/thread/stdcpp/SDL_sysmutex.cpp
@@ -79,6 +79,21 @@ SDL_mutexP(SDL_mutex * mutex)
}
}
+/* TryLock the mutex */
+int
+SDL_TryLockMutex(SDL_mutex * mutex)
+{
+ int retval = 0;
+ if (mutex == NULL) {
+ return SDL_SetError("Passed a NULL mutex");
+ }
+
+ if (mutex->cpp_mutex.try_lock() == false) {
+ retval = SDL_MUTEX_TIMEDOUT;
+ }
+ return retval;
+}
+
/* Unlock the mutex */
extern "C"
int