mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
WinRT: added Win10/UWP (Universal Windows Platform) support
"UWP" appears to be Microsoft's new name for WinRT/Windows-Store APIs. This set of changes updates SDL's WinRT backends to support the Win10 flavor of WinRT. It has been tested on Win10 on a desktop. In theory, it should also support Win10 on other devices (phone, Xbox One, etc.), however further patches may be necessary. This adds: - a set of MSVC 2015 project files, for use in creating UWP apps - modifications to various pieces of SDL, in order to compile via MSVC 2015 + the Win10 API set - enables SDL_Window resizing and programmatic-fullscreen toggling, when using the WinRT backend - WinRT README updates
This commit is contained in:
@@ -10,6 +10,7 @@ primarily, via a Microsoft-run online store (of the same name).
|
||||
|
||||
Some of the operating systems that include WinRT, are:
|
||||
|
||||
* Windows 10, via its Universal Windows Platform (UWP) APIs
|
||||
* Windows 8.x
|
||||
* Windows RT 8.x (aka. Windows 8.x for ARM processors)
|
||||
* Windows Phone 8.x
|
||||
@@ -18,12 +19,12 @@ Some of the operating systems that include WinRT, are:
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* Microsoft Visual C++ (aka Visual Studio), either 2013 or 2012 versions
|
||||
* Microsoft Visual C++ (aka Visual Studio), either 2015, 2013, or 2012
|
||||
- Free, "Community" or "Express" editions may be used, so long as they
|
||||
include support for either "Windows Store" or "Windows Phone" apps.
|
||||
"Express" versions marked as supporting "Windows Desktop" development
|
||||
typically do not include support for creating WinRT apps, to note.
|
||||
(The "Community" edition of Visual C++ 2013 does, however, support both
|
||||
(The "Community" editions of Visual C++ do, however, support both
|
||||
desktop/Win32 and WinRT development).
|
||||
- Visual C++ 2012 can only build apps that target versions 8.0 of Windows,
|
||||
or Windows Phone. 8.0-targetted apps will run on devices running 8.1
|
||||
@@ -50,25 +51,21 @@ Status
|
||||
Here is a rough list of what works, and what doens't:
|
||||
|
||||
* What works:
|
||||
* compilation via Visual C++ 2012 and 2013
|
||||
* compilation via Visual C++ 2012 through 2015
|
||||
* compile-time platform detection for SDL programs. The C/C++ #define,
|
||||
`__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT.
|
||||
* GPU-accelerated 2D rendering, via SDL_Renderer.
|
||||
* OpenGL ES 2, via the ANGLE library (included separately from SDL)
|
||||
* software rendering, via either SDL_Surface (optionally in conjunction with
|
||||
SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the
|
||||
SDL_Renderer APIs
|
||||
* threads. Significant chunks of Win32's threading APIs are not available in
|
||||
WinRT. A new, SDL threading backend was built using C++11's threading APIs
|
||||
(std::thread, std::mutex, std::condition_variable, etc.), which C or C++
|
||||
programs alike can access via SDL's threading APIs. Support for thread
|
||||
priorities is not, however, currently available, due to restrictions in
|
||||
WinRT's own API set.
|
||||
* threads
|
||||
* timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(),
|
||||
SDL_GetPerformanceFrequency(), etc.)
|
||||
* file I/O via SDL_RWops
|
||||
* mouse input (unsupported on Windows Phone)
|
||||
* audio, via a modified version of SDL's XAudio2 backend
|
||||
* .DLL file loading. Libraries must be packaged inside applications. Loading
|
||||
* .DLL file loading. Libraries *MUST* be packaged inside applications. Loading
|
||||
anything outside of the app is not supported.
|
||||
* system path retrieval via SDL's filesystem APIs
|
||||
* game controllers. Support is provided via the SDL_Joystick and
|
||||
@@ -76,10 +73,7 @@ Here is a rough list of what works, and what doens't:
|
||||
* multi-touch input
|
||||
* app events. SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as
|
||||
appropriate.
|
||||
* window events. SDL_WINDOWEVENT_MINIMIZED and SDL_WINDOWEVENT_RESTORED are
|
||||
sent out on app suspend and resume, respectively. SDL_WINDOWEVENT_SHOWN and
|
||||
SDL_WINDOWEVENT_HIDDEN are also sent, but not necessarily on app suspend or
|
||||
resume, as WinRT treats these two concepts differently..
|
||||
* window events
|
||||
* using Direct3D 11.x APIs outside of SDL. Non-XAML / Direct3D-only apps can
|
||||
choose to render content directly via Direct3D, using SDL to manage the
|
||||
internal WinRT window, as well as input and audio. (Use
|
||||
@@ -89,24 +83,13 @@ Here is a rough list of what works, and what doens't:
|
||||
* What partially works:
|
||||
* keyboard input. Most of WinRT's documented virtual keys are supported, as
|
||||
well as many keys with documented hardware scancodes.
|
||||
* OpenGL. Experimental support for OpenGL ES 2 is available via the ANGLE
|
||||
project, using either:
|
||||
* MS Open Technologies' "ms-master" repository, at https://github.com/MSOpenTech/angle
|
||||
(for use with Windows 8.1+ or Windows Phone 8.1+)
|
||||
* MS Open Technologies' "angle-win8.0" repository, at https://github.com/MSOpenTech/angle-win8.0
|
||||
(for Windows 8.0 only!)
|
||||
* Google's main ANGLE repository, at https://chromium.googlesource.com/angle/angle
|
||||
* SDLmain. WinRT uses a different signature for each app's main() function.
|
||||
SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp
|
||||
(in `SDL\src\main\winrt\`) directly in order for their C-style main()
|
||||
functions to be called.
|
||||
* XAML interoperability. This feature is currently experimental (there are
|
||||
**many** known bugs in this, at present!), preliminary, and only for
|
||||
Windows 8.x/RT at the moment. Windows Phone + XAML support is still
|
||||
pending.
|
||||
|
||||
* What doesn't work:
|
||||
* compilation with anything other than Visual C++ 2012 or 2013
|
||||
* compilation with anything other than Visual C++
|
||||
* programmatically-created custom cursors. These don't appear to be supported
|
||||
by WinRT. Different OS-provided cursors can, however, be created via
|
||||
SDL_CreateSystemCursor() (unsupported on Windows Phone)
|
||||
@@ -236,10 +219,10 @@ To set this up for SDL/WinRT, you'll need to run through the following steps:
|
||||
4. find SDL/WinRT's Visual C++ project file and open it. Different project
|
||||
files exist for different WinRT platforms. All of them are in SDL's
|
||||
source distribution, in the following directories:
|
||||
* `VisualC-WinRT/WinPhone80_VS2012/` - for Windows Phone 8.0 apps
|
||||
* `VisualC-WinRT/UWP_VS2015/` - for Windows 10 / UWP apps
|
||||
* `VisualC-WinRT/WinPhone81_VS2013/` - for Windows Phone 8.1 apps
|
||||
* `VisualC-WinRT/WinRT80_VS2012/` - for Windows 8.0 apps
|
||||
* `VisualC-WinRT/WinRT81_VS2013/` - for Windows 8.1 apps
|
||||
* `VisualC-WinRT/WinRT80_VS2012/` - for Windows 8.0 apps
|
||||
* `VisualC-WinRT/WinRT81_VS2013/` - for Windows 8.1 apps
|
||||
5. once the project has been added, right-click on your app's project and
|
||||
select, "References..."
|
||||
6. click on the button titled, "Add New Reference..."
|
||||
@@ -400,11 +383,11 @@ A list of unsupported C APIs can be found at
|
||||
<http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx>
|
||||
|
||||
General information on using the C runtime in WinRT can be found at
|
||||
<http://msdn.microsoft.com/en-us/LIBRARY/hh972425(v=vs.110).aspx>
|
||||
<https://msdn.microsoft.com/en-us/library/hh972425.aspx>
|
||||
|
||||
A list of supported Win32 APIs for Windows 8/RT apps can be found at
|
||||
A list of supported Win32 APIs for WinRT apps can be found at
|
||||
<http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx>. To note,
|
||||
the list of supported Win32 APIs for Windows Phone 8 development is different.
|
||||
the list of supported Win32 APIs for Windows Phone 8.0 is different.
|
||||
That list can be found at
|
||||
<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662956(v=vs.105).aspx>
|
||||
|
||||
@@ -422,7 +405,12 @@ Simulator. Once you do that, any time you build and run the app, the app will
|
||||
launch in window, rather than full-screen.
|
||||
|
||||
|
||||
#### 7.A. Running apps on ARM-based devices ####
|
||||
#### 7.A. Running apps on older, ARM-based, "Windows RT" devices ####
|
||||
|
||||
**These instructions do not include Windows Phone, despite Windows Phone
|
||||
typically running on ARM processors.** They are specifically for devices
|
||||
that use the "Windows RT" operating system, which was a modified version of
|
||||
Windows 8.x that ran primarily on ARM-based tablet computers.
|
||||
|
||||
To build and run the app on ARM-based, "Windows RT" devices, you'll need to:
|
||||
|
||||
@@ -433,9 +421,9 @@ To build and run the app on ARM-based, "Windows RT" devices, you'll need to:
|
||||
Windows RT device (on the network).
|
||||
|
||||
Microsoft's Remote Debugger can be found at
|
||||
<http://msdn.microsoft.com/en-us/library/vstudio/bt727f1t.aspx>. Please note
|
||||
<https://msdn.microsoft.com/en-us/library/hh441469.aspx>. Please note
|
||||
that separate versions of this debugger exist for different versions of Visual
|
||||
C++, one for debugging with MSVC 2012, another for debugging with MSVC 2013.
|
||||
C++, one each for MSVC 2015, 2013, and 2012.
|
||||
|
||||
To setup Visual C++ to launch your app on an ARM device:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user