WinRT: more "Windows RT" to "WinRT" renaming
authorDavid Ludwig <dludwig@pobox.com>
Tue, 27 Aug 2013 12:20:35 -0400
changeset 8500f25ef28d61e8
parent 8499 00e397f1b7a8
child 8501 260da37dd755
WinRT: more "Windows RT" to "WinRT" renaming
include/SDL_main.h
include/SDL_stdinc.h
include/SDL_system.h
include/SDL_syswm.h
src/audio/xaudio2/SDL_xaudio2.c
src/audio/xaudio2/SDL_xaudio2_winrthelpers.h
src/core/winrt/SDL_winrtapp.cpp
src/video/winrt/SDL_winrtmouse.cpp
src/video/winrt/SDL_winrtvideo.cpp
     1.1 --- a/include/SDL_main.h	Tue Aug 27 12:16:42 2013 -0400
     1.2 +++ b/include/SDL_main.h	Tue Aug 27 12:20:35 2013 -0400
     1.3 @@ -40,7 +40,7 @@
     1.4  #define SDL_MAIN_AVAILABLE
     1.5  
     1.6  #elif defined(__WINRT__)
     1.7 -/* On Windows RT, SDL provides a main function that initializes CoreApplication,
     1.8 +/* On WinRT, SDL provides a main function that initializes CoreApplication,
     1.9     creating an instance of IFrameworkView in the process.
    1.10  
    1.11     Please note that #include'ing SDL_main.h is not enough to get a main()
     2.1 --- a/include/SDL_stdinc.h	Tue Aug 27 12:16:42 2013 -0400
     2.2 +++ b/include/SDL_stdinc.h	Tue Aug 27 12:20:35 2013 -0400
     2.3 @@ -73,7 +73,7 @@
     2.4  #ifdef HAVE_MATH_H
     2.5  # if defined(__WINRT__)
     2.6  /* Defining _USE_MATH_DEFINES is required to get M_PI to be defined on
     2.7 -   Windows RT.  See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
     2.8 +   WinRT.  See http://msdn.microsoft.com/en-us/library/4hwaceh6.aspx
     2.9     for more information.
    2.10  */
    2.11  #  define _USE_MATH_DEFINES
     3.1 --- a/include/SDL_system.h	Tue Aug 27 12:16:42 2013 -0400
     3.2 +++ b/include/SDL_system.h	Tue Aug 27 12:20:35 2013 -0400
     3.3 @@ -94,11 +94,11 @@
     3.4  #endif /* __ANDROID__ */
     3.5  
     3.6  
     3.7 -/* Platform specific functions for Windows RT */
     3.8 +/* Platform specific functions for WinRT */
     3.9  #if defined(__WINRT__) && __WINRT__
    3.10  
    3.11  /**
    3.12 - *  \brief Windows RT / Windows Phone path types
    3.13 + *  \brief WinRT / Windows Phone path types
    3.14   */
    3.15  typedef enum
    3.16  {
    3.17 @@ -122,9 +122,9 @@
    3.18  
    3.19  
    3.20  /**
    3.21 - *  \brief Retrieves a Windows RT defined path on the local file system
    3.22 + *  \brief Retrieves a WinRT defined path on the local file system
    3.23   *
    3.24 - *  \note Documentation on most app-specific path types on Windows RT
    3.25 + *  \note Documentation on most app-specific path types on WinRT
    3.26   *      can be found on MSDN, at the URL:
    3.27   *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
    3.28   *
    3.29 @@ -139,9 +139,9 @@
    3.30  extern DECLSPEC const wchar_t * SDLCALL SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType);
    3.31  
    3.32  /**
    3.33 - *  \brief Retrieves a Windows RT defined path on the local file system
    3.34 + *  \brief Retrieves a WinRT defined path on the local file system
    3.35   *
    3.36 - *  \note Documentation on most app-specific path types on Windows RT
    3.37 + *  \note Documentation on most app-specific path types on WinRT
    3.38   *      can be found on MSDN, at the URL:
    3.39   *      http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
    3.40   *
     4.1 --- a/include/SDL_syswm.h	Tue Aug 27 12:16:42 2013 -0400
     4.2 +++ b/include/SDL_syswm.h	Tue Aug 27 12:20:35 2013 -0400
     4.3 @@ -177,7 +177,7 @@
     4.4  #if defined(SDL_VIDEO_DRIVER_WINRT)
     4.5          struct
     4.6          {
     4.7 -            IUnknown * window;          /**< The Windows RT CoreWindow */
     4.8 +            IUnknown * window;          /**< The WinRT CoreWindow */
     4.9          } winrt;
    4.10  #endif
    4.11  #if defined(SDL_VIDEO_DRIVER_X11)
     5.1 --- a/src/audio/xaudio2/SDL_xaudio2.c	Tue Aug 27 12:16:42 2013 -0400
     5.2 +++ b/src/audio/xaudio2/SDL_xaudio2.c	Tue Aug 27 12:20:35 2013 -0400
     5.3 @@ -22,7 +22,7 @@
     5.4  /* WinRT NOTICE:
     5.5  
     5.6     A number of changes were warranted to SDL's XAudio2 backend in order to
     5.7 -   get it compiling for Windows RT.
     5.8 +   get it compiling for WinRT.
     5.9  
    5.10     When compiling for WinRT, XAudio2.h requires that it be compiled in a C++
    5.11     file, and not a straight C file.  Trying to compile it as C leads to lots
    5.12 @@ -57,13 +57,13 @@
    5.13     http://blogs.msdn.com/b/chuckw/archive/2012/04/02/xaudio2-and-windows-8-consumer-preview.aspx
    5.14  
    5.15     1. Windows' thread synchronization function, CreateSemaphore, was removed
    5.16 -      from Windows RT.  SDL's semaphore API was substituted instead.
    5.17 +      from WinRT.  SDL's semaphore API was substituted instead.
    5.18     2. The method calls, IXAudio2::GetDeviceCount and IXAudio2::GetDeviceDetails
    5.19        were removed from the XAudio2 API.  Microsoft is telling developers to
    5.20        use APIs in Windows::Foundation instead.
    5.21        For SDL, the missing methods were reimplemented using the APIs Microsoft
    5.22        said to use.
    5.23 -   3. CoInitialize and CoUninitialize are not available in Windows RT.
    5.24 +   3. CoInitialize and CoUninitialize are not available in WinRT.
    5.25        These calls were removed, as COM will have been initialized earlier,
    5.26        at least by the call to the WinRT app's main function
    5.27        (aka 'int main(Platform::Array<Platform::String^>^)).  (DLudwig:
    5.28 @@ -71,7 +71,7 @@
    5.29        a tag of [MTAThread], which should initialize COM.  My understanding
    5.30        of COM is somewhat limited, and I may be incorrect here.)
    5.31     4. IXAudio2::CreateMasteringVoice changed its integer-based 'DeviceIndex'
    5.32 -      argument to a string-based one, 'szDeviceId'.  In Windows RT, the
    5.33 +      argument to a string-based one, 'szDeviceId'.  In WinRT, the
    5.34        string-based argument will be used.
    5.35  */
    5.36  
     6.1 --- a/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h	Tue Aug 27 12:16:42 2013 -0400
     6.2 +++ b/src/audio/xaudio2/SDL_xaudio2_winrthelpers.h	Tue Aug 27 12:20:35 2013 -0400
     6.3 @@ -2,7 +2,7 @@
     6.4  #pragma once
     6.5  
     6.6  //
     6.7 -// Re-implementation of methods removed from XAudio2 (in Windows RT):
     6.8 +// Re-implementation of methods removed from XAudio2 (in WinRT):
     6.9  //
    6.10  
    6.11  typedef struct XAUDIO2_DEVICE_DETAILS
    6.12 @@ -22,19 +22,19 @@
    6.13  // C-style macros to call XAudio2's methods in C++:
    6.14  //
    6.15  
    6.16 -#define IXAudio2_CreateMasteringVoice(A, B, C, D, E, F, G) (A)->CreateMasteringVoice((B), (C), (D), (E), (F), (G))
    6.17 -#define IXAudio2_CreateSourceVoice(A, B, C, D, E, F, G, H) (A)->CreateSourceVoice((B), (C), (D), (E), (F), (G), (H))
    6.18 -#define IXAudio2_QueryInterface(A, B, C) (A)->QueryInterface((B), (C))
    6.19 -#define IXAudio2_Release(A) (A)->Release()
    6.20 -#define IXAudio2_StartEngine(A) (A)->StartEngine()
    6.21 -#define IXAudio2_StopEngine(A) (A)->StopEngine()
    6.22 -
    6.23 -#define IXAudio2MasteringVoice_DestroyVoice(A) (A)->DestroyVoice()
    6.24 -
    6.25 -#define IXAudio2SourceVoice_DestroyVoice(A) (A)->DestroyVoice()
    6.26 -#define IXAudio2SourceVoice_Discontinuity(A) (A)->Discontinuity()
    6.27 -#define IXAudio2SourceVoice_FlushSourceBuffers(A) (A)->FlushSourceBuffers()
    6.28 -#define IXAudio2SourceVoice_GetState(A, B) (A)->GetState((B))
    6.29 -#define IXAudio2SourceVoice_Start(A, B, C) (A)->Start((B), (C))
    6.30 -#define IXAudio2SourceVoice_Stop(A, B, C) (A)->Stop((B), (C))
    6.31 -#define IXAudio2SourceVoice_SubmitSourceBuffer(A, B, C) (A)->SubmitSourceBuffer((B), (C))
    6.32 +#define IXAudio2_CreateMasteringVoice(A, B, C, D, E, F, G) (A)->CreateMasteringVoice((B), (C), (D), (E), (F), (G))
    6.33 +#define IXAudio2_CreateSourceVoice(A, B, C, D, E, F, G, H) (A)->CreateSourceVoice((B), (C), (D), (E), (F), (G), (H))
    6.34 +#define IXAudio2_QueryInterface(A, B, C) (A)->QueryInterface((B), (C))
    6.35 +#define IXAudio2_Release(A) (A)->Release()
    6.36 +#define IXAudio2_StartEngine(A) (A)->StartEngine()
    6.37 +#define IXAudio2_StopEngine(A) (A)->StopEngine()
    6.38 +
    6.39 +#define IXAudio2MasteringVoice_DestroyVoice(A) (A)->DestroyVoice()
    6.40 +
    6.41 +#define IXAudio2SourceVoice_DestroyVoice(A) (A)->DestroyVoice()
    6.42 +#define IXAudio2SourceVoice_Discontinuity(A) (A)->Discontinuity()
    6.43 +#define IXAudio2SourceVoice_FlushSourceBuffers(A) (A)->FlushSourceBuffers()
    6.44 +#define IXAudio2SourceVoice_GetState(A, B) (A)->GetState((B))
    6.45 +#define IXAudio2SourceVoice_Start(A, B, C) (A)->Start((B), (C))
    6.46 +#define IXAudio2SourceVoice_Stop(A, B, C) (A)->Stop((B), (C))
    6.47 +#define IXAudio2SourceVoice_SubmitSourceBuffer(A, B, C) (A)->SubmitSourceBuffer((B), (C))
     7.1 --- a/src/core/winrt/SDL_winrtapp.cpp	Tue Aug 27 12:16:42 2013 -0400
     7.2 +++ b/src/core/winrt/SDL_winrtapp.cpp	Tue Aug 27 12:20:35 2013 -0400
     7.3 @@ -56,7 +56,7 @@
     7.4  typedef int (*SDL_WinRT_MainFunction)(int, char **);
     7.5  static SDL_WinRT_MainFunction SDL_WinRT_main = nullptr;
     7.6  
     7.7 -// HACK, DLudwig: record a reference to the global, Windows RT 'app'/view.
     7.8 +// HACK, DLudwig: record a reference to the global, WinRT 'app'/view.
     7.9  // SDL/WinRT will use this throughout its code.
    7.10  //
    7.11  // TODO, WinRT: consider replacing SDL_WinRTGlobalApp with something
    7.12 @@ -129,7 +129,7 @@
    7.13  
    7.14      // Set the orientation/rotation preferences.  Please note that this does
    7.15      // not constitute a 100%-certain lock of a given set of possible
    7.16 -    // orientations.  According to Microsoft's documentation on Windows RT [1]
    7.17 +    // orientations.  According to Microsoft's documentation on WinRT [1]
    7.18      // when a device is not capable of being rotated, Windows may ignore
    7.19      // the orientation preferences, and stick to what the device is capable of
    7.20      // displaying.
     8.1 --- a/src/video/winrt/SDL_winrtmouse.cpp	Tue Aug 27 12:16:42 2013 -0400
     8.2 +++ b/src/video/winrt/SDL_winrtmouse.cpp	Tue Aug 27 12:20:35 2013 -0400
     8.3 @@ -1,159 +1,159 @@
     8.4 -/*
     8.5 -  Simple DirectMedia Layer
     8.6 -  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
     8.7 -
     8.8 -  This software is provided 'as-is', without any express or implied
     8.9 -  warranty.  In no event will the authors be held liable for any damages
    8.10 -  arising from the use of this software.
    8.11 -
    8.12 -  Permission is granted to anyone to use this software for any purpose,
    8.13 -  including commercial applications, and to alter it and redistribute it
    8.14 -  freely, subject to the following restrictions:
    8.15 -
    8.16 -  1. The origin of this software must not be misrepresented; you must not
    8.17 -     claim that you wrote the original software. If you use this software
    8.18 -     in a product, an acknowledgment in the product documentation would be
    8.19 -     appreciated but is not required.
    8.20 -  2. Altered source versions must be plainly marked as such, and must not be
    8.21 -     misrepresented as being the original software.
    8.22 -  3. This notice may not be removed or altered from any source distribution.
    8.23 -*/
    8.24 -
    8.25 -#include "SDL_config.h"
    8.26 -
    8.27 -#if SDL_VIDEO_DRIVER_WINRT
    8.28 -
    8.29 -/*
    8.30 - * Windows includes:
    8.31 - */
    8.32 -#include <Windows.h>
    8.33 -using namespace Windows::UI::Core;
    8.34 -using Windows::UI::Core::CoreCursor;
    8.35 -
    8.36 -/*
    8.37 - * SDL includes:
    8.38 - */
    8.39 -extern "C" {
    8.40 -#include "SDL_assert.h"
    8.41 -#include "../../events/SDL_mouse_c.h"
    8.42 -#include "../SDL_sysvideo.h"
    8.43 -#include "SDL_events.h"
    8.44 -#include "SDL_log.h"
    8.45 -}
    8.46 -
    8.47 -#include "../../core/winrt/SDL_winrtapp.h"
    8.48 -#include "SDL_winrtmouse.h"
    8.49 -
    8.50 -
    8.51 -static SDL_bool WINRT_UseRelativeMouseMode = SDL_FALSE;
    8.52 -
    8.53 -
    8.54 -static SDL_Cursor *
    8.55 -WINRT_CreateSystemCursor(SDL_SystemCursor id)
    8.56 -{
    8.57 -    SDL_Cursor *cursor;
    8.58 -    CoreCursorType cursorType = CoreCursorType::Arrow;
    8.59 -
    8.60 -    switch(id)
    8.61 -    {
    8.62 -    default:
    8.63 -        SDL_assert(0);
    8.64 -        return NULL;
    8.65 -    case SDL_SYSTEM_CURSOR_ARROW:     cursorType = CoreCursorType::Arrow; break;
    8.66 -    case SDL_SYSTEM_CURSOR_IBEAM:     cursorType = CoreCursorType::IBeam; break;
    8.67 -    case SDL_SYSTEM_CURSOR_WAIT:      cursorType = CoreCursorType::Wait; break;
    8.68 -    case SDL_SYSTEM_CURSOR_CROSSHAIR: cursorType = CoreCursorType::Cross; break;
    8.69 -    case SDL_SYSTEM_CURSOR_WAITARROW: cursorType = CoreCursorType::Wait; break;
    8.70 -    case SDL_SYSTEM_CURSOR_SIZENWSE:  cursorType = CoreCursorType::SizeNorthwestSoutheast; break;
    8.71 -    case SDL_SYSTEM_CURSOR_SIZENESW:  cursorType = CoreCursorType::SizeNortheastSouthwest; break;
    8.72 -    case SDL_SYSTEM_CURSOR_SIZEWE:    cursorType = CoreCursorType::SizeWestEast; break;
    8.73 -    case SDL_SYSTEM_CURSOR_SIZENS:    cursorType = CoreCursorType::SizeNorthSouth; break;
    8.74 -    case SDL_SYSTEM_CURSOR_SIZEALL:   cursorType = CoreCursorType::SizeAll; break;
    8.75 -    case SDL_SYSTEM_CURSOR_NO:        cursorType = CoreCursorType::UniversalNo; break;
    8.76 -    case SDL_SYSTEM_CURSOR_HAND:      cursorType = CoreCursorType::Hand; break;
    8.77 -    }
    8.78 -
    8.79 -    cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor));
    8.80 -    if (cursor) {
    8.81 -        /* Create a pointer to a COM reference to a cursor.  The extra
    8.82 -           pointer is used (on top of the COM reference) to allow the cursor
    8.83 -           to be referenced by the SDL_cursor's driverdata field, which is
    8.84 -           a void pointer.
    8.85 -        */
    8.86 -        CoreCursor ^* theCursor = new CoreCursor^(nullptr);
    8.87 -        *theCursor = ref new CoreCursor(cursorType, 0);
    8.88 -        cursor->driverdata = (void *) theCursor;
    8.89 -    } else {
    8.90 -        SDL_OutOfMemory();
    8.91 -    }
    8.92 -
    8.93 -    return cursor;
    8.94 -}
    8.95 -
    8.96 -static SDL_Cursor *
    8.97 -WINRT_CreateDefaultCursor()
    8.98 -{
    8.99 -    return WINRT_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
   8.100 -}
   8.101 -
   8.102 -static void
   8.103 -WINRT_FreeCursor(SDL_Cursor * cursor)
   8.104 -{
   8.105 -    if (cursor->driverdata) {
   8.106 -        CoreCursor ^* theCursor = (CoreCursor ^*) cursor->driverdata;
   8.107 -        *theCursor = nullptr;       // Release the COM reference to the CoreCursor
   8.108 -        delete theCursor;           // Delete the pointer to the COM reference
   8.109 -    }
   8.110 -    SDL_free(cursor);
   8.111 -}
   8.112 -
   8.113 -static int
   8.114 -WINRT_ShowCursor(SDL_Cursor * cursor)
   8.115 -{
   8.116 -    if (cursor) {
   8.117 -        CoreCursor ^* theCursor = (CoreCursor ^*) cursor->driverdata;
   8.118 -        CoreWindow::GetForCurrentThread()->PointerCursor = *theCursor;
   8.119 -    } else {
   8.120 -        CoreWindow::GetForCurrentThread()->PointerCursor = nullptr;
   8.121 -    }
   8.122 -    return 0;
   8.123 -}
   8.124 -
   8.125 -static int
   8.126 -WINRT_SetRelativeMouseMode(SDL_bool enabled)
   8.127 -{
   8.128 -    WINRT_UseRelativeMouseMode = enabled;
   8.129 -    return 0;
   8.130 -}
   8.131 -
   8.132 -void
   8.133 -WINRT_InitMouse(_THIS)
   8.134 -{
   8.135 -    SDL_Mouse *mouse = SDL_GetMouse();
   8.136 -
   8.137 -    /* DLudwig, Dec 3, 2012: Windows RT does not currently provide APIs for
   8.138 -       the following features, AFAIK:
   8.139 -        - custom cursors  (multiple system cursors are, however, available)
   8.140 -        - programmatically moveable cursors
   8.141 -    */
   8.142 -
   8.143 -#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
   8.144 -    //mouse->CreateCursor = WINRT_CreateCursor;
   8.145 -    mouse->CreateSystemCursor = WINRT_CreateSystemCursor;
   8.146 -    mouse->ShowCursor = WINRT_ShowCursor;
   8.147 -    mouse->FreeCursor = WINRT_FreeCursor;
   8.148 -    //mouse->WarpMouse = WINRT_WarpMouse;
   8.149 -    mouse->SetRelativeMouseMode = WINRT_SetRelativeMouseMode;
   8.150 -
   8.151 -    SDL_SetDefaultCursor(WINRT_CreateDefaultCursor());
   8.152 -#endif
   8.153 -}
   8.154 -
   8.155 -void
   8.156 -WINRT_QuitMouse(_THIS)
   8.157 -{
   8.158 -}
   8.159 -
   8.160 +/*
   8.161 +  Simple DirectMedia Layer
   8.162 +  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
   8.163 +
   8.164 +  This software is provided 'as-is', without any express or implied
   8.165 +  warranty.  In no event will the authors be held liable for any damages
   8.166 +  arising from the use of this software.
   8.167 +
   8.168 +  Permission is granted to anyone to use this software for any purpose,
   8.169 +  including commercial applications, and to alter it and redistribute it
   8.170 +  freely, subject to the following restrictions:
   8.171 +
   8.172 +  1. The origin of this software must not be misrepresented; you must not
   8.173 +     claim that you wrote the original software. If you use this software
   8.174 +     in a product, an acknowledgment in the product documentation would be
   8.175 +     appreciated but is not required.
   8.176 +  2. Altered source versions must be plainly marked as such, and must not be
   8.177 +     misrepresented as being the original software.
   8.178 +  3. This notice may not be removed or altered from any source distribution.
   8.179 +*/
   8.180 +
   8.181 +#include "SDL_config.h"
   8.182 +
   8.183 +#if SDL_VIDEO_DRIVER_WINRT
   8.184 +
   8.185 +/*
   8.186 + * Windows includes:
   8.187 + */
   8.188 +#include <Windows.h>
   8.189 +using namespace Windows::UI::Core;
   8.190 +using Windows::UI::Core::CoreCursor;
   8.191 +
   8.192 +/*
   8.193 + * SDL includes:
   8.194 + */
   8.195 +extern "C" {
   8.196 +#include "SDL_assert.h"
   8.197 +#include "../../events/SDL_mouse_c.h"
   8.198 +#include "../SDL_sysvideo.h"
   8.199 +#include "SDL_events.h"
   8.200 +#include "SDL_log.h"
   8.201 +}
   8.202 +
   8.203 +#include "../../core/winrt/SDL_winrtapp.h"
   8.204 +#include "SDL_winrtmouse.h"
   8.205 +
   8.206 +
   8.207 +static SDL_bool WINRT_UseRelativeMouseMode = SDL_FALSE;
   8.208 +
   8.209 +
   8.210 +static SDL_Cursor *
   8.211 +WINRT_CreateSystemCursor(SDL_SystemCursor id)
   8.212 +{
   8.213 +    SDL_Cursor *cursor;
   8.214 +    CoreCursorType cursorType = CoreCursorType::Arrow;
   8.215 +
   8.216 +    switch(id)
   8.217 +    {
   8.218 +    default:
   8.219 +        SDL_assert(0);
   8.220 +        return NULL;
   8.221 +    case SDL_SYSTEM_CURSOR_ARROW:     cursorType = CoreCursorType::Arrow; break;
   8.222 +    case SDL_SYSTEM_CURSOR_IBEAM:     cursorType = CoreCursorType::IBeam; break;
   8.223 +    case SDL_SYSTEM_CURSOR_WAIT:      cursorType = CoreCursorType::Wait; break;
   8.224 +    case SDL_SYSTEM_CURSOR_CROSSHAIR: cursorType = CoreCursorType::Cross; break;
   8.225 +    case SDL_SYSTEM_CURSOR_WAITARROW: cursorType = CoreCursorType::Wait; break;
   8.226 +    case SDL_SYSTEM_CURSOR_SIZENWSE:  cursorType = CoreCursorType::SizeNorthwestSoutheast; break;
   8.227 +    case SDL_SYSTEM_CURSOR_SIZENESW:  cursorType = CoreCursorType::SizeNortheastSouthwest; break;
   8.228 +    case SDL_SYSTEM_CURSOR_SIZEWE:    cursorType = CoreCursorType::SizeWestEast; break;
   8.229 +    case SDL_SYSTEM_CURSOR_SIZENS:    cursorType = CoreCursorType::SizeNorthSouth; break;
   8.230 +    case SDL_SYSTEM_CURSOR_SIZEALL:   cursorType = CoreCursorType::SizeAll; break;
   8.231 +    case SDL_SYSTEM_CURSOR_NO:        cursorType = CoreCursorType::UniversalNo; break;
   8.232 +    case SDL_SYSTEM_CURSOR_HAND:      cursorType = CoreCursorType::Hand; break;
   8.233 +    }
   8.234 +
   8.235 +    cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor));
   8.236 +    if (cursor) {
   8.237 +        /* Create a pointer to a COM reference to a cursor.  The extra
   8.238 +           pointer is used (on top of the COM reference) to allow the cursor
   8.239 +           to be referenced by the SDL_cursor's driverdata field, which is
   8.240 +           a void pointer.
   8.241 +        */
   8.242 +        CoreCursor ^* theCursor = new CoreCursor^(nullptr);
   8.243 +        *theCursor = ref new CoreCursor(cursorType, 0);
   8.244 +        cursor->driverdata = (void *) theCursor;
   8.245 +    } else {
   8.246 +        SDL_OutOfMemory();
   8.247 +    }
   8.248 +
   8.249 +    return cursor;
   8.250 +}
   8.251 +
   8.252 +static SDL_Cursor *
   8.253 +WINRT_CreateDefaultCursor()
   8.254 +{
   8.255 +    return WINRT_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW);
   8.256 +}
   8.257 +
   8.258 +static void
   8.259 +WINRT_FreeCursor(SDL_Cursor * cursor)
   8.260 +{
   8.261 +    if (cursor->driverdata) {
   8.262 +        CoreCursor ^* theCursor = (CoreCursor ^*) cursor->driverdata;
   8.263 +        *theCursor = nullptr;       // Release the COM reference to the CoreCursor
   8.264 +        delete theCursor;           // Delete the pointer to the COM reference
   8.265 +    }
   8.266 +    SDL_free(cursor);
   8.267 +}
   8.268 +
   8.269 +static int
   8.270 +WINRT_ShowCursor(SDL_Cursor * cursor)
   8.271 +{
   8.272 +    if (cursor) {
   8.273 +        CoreCursor ^* theCursor = (CoreCursor ^*) cursor->driverdata;
   8.274 +        CoreWindow::GetForCurrentThread()->PointerCursor = *theCursor;
   8.275 +    } else {
   8.276 +        CoreWindow::GetForCurrentThread()->PointerCursor = nullptr;
   8.277 +    }
   8.278 +    return 0;
   8.279 +}
   8.280 +
   8.281 +static int
   8.282 +WINRT_SetRelativeMouseMode(SDL_bool enabled)
   8.283 +{
   8.284 +    WINRT_UseRelativeMouseMode = enabled;
   8.285 +    return 0;
   8.286 +}
   8.287 +
   8.288 +void
   8.289 +WINRT_InitMouse(_THIS)
   8.290 +{
   8.291 +    SDL_Mouse *mouse = SDL_GetMouse();
   8.292 +
   8.293 +    /* DLudwig, Dec 3, 2012: WinRT does not currently provide APIs for
   8.294 +       the following features, AFAIK:
   8.295 +        - custom cursors  (multiple system cursors are, however, available)
   8.296 +        - programmatically moveable cursors
   8.297 +    */
   8.298 +
   8.299 +#if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
   8.300 +    //mouse->CreateCursor = WINRT_CreateCursor;
   8.301 +    mouse->CreateSystemCursor = WINRT_CreateSystemCursor;
   8.302 +    mouse->ShowCursor = WINRT_ShowCursor;
   8.303 +    mouse->FreeCursor = WINRT_FreeCursor;
   8.304 +    //mouse->WarpMouse = WINRT_WarpMouse;
   8.305 +    mouse->SetRelativeMouseMode = WINRT_SetRelativeMouseMode;
   8.306 +
   8.307 +    SDL_SetDefaultCursor(WINRT_CreateDefaultCursor());
   8.308 +#endif
   8.309 +}
   8.310 +
   8.311 +void
   8.312 +WINRT_QuitMouse(_THIS)
   8.313 +{
   8.314 +}
   8.315 +
   8.316  // Applies necessary geometric transformations to raw cursor positions:
   8.317  static Windows::Foundation::Point
   8.318  TransformCursor(SDL_Window * window, Windows::Foundation::Point rawPosition)
   8.319 @@ -166,8 +166,8 @@
   8.320      outputPosition.X = rawPosition.X * (((float32)window->w) / nativeWindow->Bounds.Width);
   8.321      outputPosition.Y = rawPosition.Y * (((float32)window->h) / nativeWindow->Bounds.Height);
   8.322      return outputPosition;
   8.323 -}
   8.324 -
   8.325 +}
   8.326 +
   8.327  static inline int
   8.328  _lround(float arg)
   8.329  {
   8.330 @@ -176,15 +176,15 @@
   8.331      } else {
   8.332          return (int)ceil(arg - 0.5f);
   8.333      }
   8.334 -}
   8.335 -
   8.336 -void
   8.337 -WINRT_ProcessMouseMovedEvent(SDL_Window * window, Windows::Devices::Input::MouseEventArgs ^args)
   8.338 -{
   8.339 -    if (!window || !WINRT_UseRelativeMouseMode) {
   8.340 -        return;
   8.341 -    }
   8.342 -
   8.343 +}
   8.344 +
   8.345 +void
   8.346 +WINRT_ProcessMouseMovedEvent(SDL_Window * window, Windows::Devices::Input::MouseEventArgs ^args)
   8.347 +{
   8.348 +    if (!window || !WINRT_UseRelativeMouseMode) {
   8.349 +        return;
   8.350 +    }
   8.351 +
   8.352      // DLudwig, 2012-12-28: On some systems, namely Visual Studio's Windows
   8.353      // Simulator, as well as Windows 8 in a Parallels 8 VM, MouseEventArgs'
   8.354      // MouseDelta field often reports very large values.  More information
   8.355 @@ -228,7 +228,7 @@
   8.356      //
   8.357      // One possible workaround would be to programmatically set the cursor's
   8.358      // position to the screen's center (when SDL's relative mouse mode is enabled),
   8.359 -    // however Windows RT does not yet seem to have the ability to set the cursor's
   8.360 +    // however WinRT does not yet seem to have the ability to set the cursor's
   8.361      // position via a public API.  Win32 did this via an API call, SetCursorPos,
   8.362      // however WinRT makes this function be private.  Apps that use it won't get
   8.363      // approved for distribution in the Windows Store.  I've yet to be able to find
   8.364 @@ -249,8 +249,8 @@
   8.365          1,
   8.366          _lround(mouseDeltaInSDLWindowCoords.X),
   8.367          _lround(mouseDeltaInSDLWindowCoords.Y));
   8.368 -}
   8.369 -
   8.370 +}
   8.371 +
   8.372  static Uint8
   8.373  WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^pt)
   8.374  {
   8.375 @@ -331,10 +331,10 @@
   8.376          pt->FrameId,
   8.377          pt->PointerId,
   8.378          WINRT_ConvertPointerUpdateKindToString(args->CurrentPoint->Properties->PointerUpdateKind));
   8.379 -}
   8.380 -
   8.381 -void
   8.382 -WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
   8.383 +}
   8.384 +
   8.385 +void
   8.386 +WINRT_ProcessPointerMovedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
   8.387  {
   8.388  #if LOG_POINTER_EVENTS
   8.389      WINRT_LogPointerEvent("pointer moved", args, TransformCursor(args->CurrentPoint->Position));
   8.390 @@ -346,9 +346,9 @@
   8.391  
   8.392      Windows::Foundation::Point transformedPoint = TransformCursor(window, args->CurrentPoint->Position);
   8.393      SDL_SendMouseMotion(window, 0, 0, (int)transformedPoint.X, (int)transformedPoint.Y);
   8.394 -}
   8.395 -
   8.396 -void
   8.397 +}
   8.398 +
   8.399 +void
   8.400  WINRT_ProcessPointerWheelChangedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
   8.401  {
   8.402  #if LOG_POINTER_EVENTS
   8.403 @@ -362,8 +362,8 @@
   8.404      // FIXME: This may need to accumulate deltas up to WHEEL_DELTA
   8.405      short motion = args->CurrentPoint->Properties->MouseWheelDelta / WHEEL_DELTA;
   8.406      SDL_SendMouseWheel(window, 0, 0, motion);
   8.407 -}
   8.408 -
   8.409 +}
   8.410 +
   8.411  void WINRT_ProcessPointerReleasedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
   8.412  {
   8.413  #if LOG_POINTER_EVENTS
   8.414 @@ -378,8 +378,8 @@
   8.415      if (button) {
   8.416          SDL_SendMouseButton(window, 0, SDL_RELEASED, button);
   8.417      }
   8.418 -}
   8.419 -
   8.420 +}
   8.421 +
   8.422  void WINRT_ProcessPointerPressedEvent(SDL_Window *window, Windows::UI::Core::PointerEventArgs ^args)
   8.423  {
   8.424  #if LOG_POINTER_EVENTS
   8.425 @@ -394,8 +394,8 @@
   8.426      if (button) {
   8.427          SDL_SendMouseButton(window, 0, SDL_PRESSED, button);
   8.428      }
   8.429 -}
   8.430 -
   8.431 -#endif /* SDL_VIDEO_DRIVER_WINRT */
   8.432 -
   8.433 -/* vi: set ts=4 sw=4 expandtab: */
   8.434 +}
   8.435 +
   8.436 +#endif /* SDL_VIDEO_DRIVER_WINRT */
   8.437 +
   8.438 +/* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/video/winrt/SDL_winrtvideo.cpp	Tue Aug 27 12:16:42 2013 -0400
     9.2 +++ b/src/video/winrt/SDL_winrtvideo.cpp	Tue Aug 27 12:20:35 2013 -0400
     9.3 @@ -132,7 +132,7 @@
     9.4  
     9.5  #define WINRTVID_DRIVER_NAME "winrt"
     9.6  VideoBootStrap WINRT_bootstrap = {
     9.7 -    WINRTVID_DRIVER_NAME, "SDL Windows RT video driver",
     9.8 +    WINRTVID_DRIVER_NAME, "SDL WinRT video driver",
     9.9      WINRT_Available, WINRT_CreateDevice
    9.10  };
    9.11