Converted README documentation to DOS text format
authorSam Lantinga <slouken@libsdl.org>
Fri, 07 Oct 2016 17:46:58 -0700
changeset 104865bf595c48fd4
parent 10485 63cc8dcc2ef9
child 10487 bd16e5899ceb
Converted README documentation to DOS text format
docs/README-android.md
docs/README-cmake.md
docs/README-directfb.md
docs/README-dynapi.md
docs/README-emscripten.md
docs/README-hg.md
docs/README-linux.md
docs/README-nacl.md
docs/README-pandora.md
docs/README-platforms.md
docs/README-psp.md
docs/README-touch.md
docs/README-wince.md
docs/README-windows.md
docs/README-winrt.md
docs/README.md
     1.1 --- a/docs/README-android.md	Fri Oct 07 17:30:21 2016 -0700
     1.2 +++ b/docs/README-android.md	Fri Oct 07 17:46:58 2016 -0700
     1.3 @@ -1,4 +1,4 @@
     1.4 -Android
     1.5 +Android
     1.6  ================================================================================
     1.7  
     1.8  Requirements:
     2.1 --- a/docs/README-cmake.md	Fri Oct 07 17:30:21 2016 -0700
     2.2 +++ b/docs/README-cmake.md	Fri Oct 07 17:46:58 2016 -0700
     2.3 @@ -1,6 +1,6 @@
     2.4 -CMake
     2.5 +CMake
     2.6  ================================================================================
     2.7 -(www.cmake.org)
     2.8 +(www.cmake.org)
     2.9  
    2.10  SDL's build system was traditionally based on autotools. Over time, this
    2.11  approach has suffered from several issues across the different supported 
     3.1 --- a/docs/README-directfb.md	Fri Oct 07 17:30:21 2016 -0700
     3.2 +++ b/docs/README-directfb.md	Fri Oct 07 17:46:58 2016 -0700
     3.3 @@ -1,5 +1,5 @@
     3.4  DirectFB
     3.5 -========
     3.6 +========
     3.7  
     3.8  Supports:
     3.9  
     4.1 --- a/docs/README-dynapi.md	Fri Oct 07 17:30:21 2016 -0700
     4.2 +++ b/docs/README-dynapi.md	Fri Oct 07 17:46:58 2016 -0700
     4.3 @@ -1,130 +1,130 @@
     4.4 -Dynamic API
     4.5 -================================================================================
     4.6 -Originally posted by Ryan at:
     4.7 -  https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U
     4.8 -
     4.9 -Background:
    4.10 -
    4.11 -- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2, 
    4.12 -  but developers are shipping their own SDL2 with individual Steam games. 
    4.13 -  These games might stop getting updates, but a newer SDL2 might be needed later. 
    4.14 -  Certainly we'll always be fixing bugs in SDL, even if a new video target isn't 
    4.15 -  ever needed, and these fixes won't make it to a game shipping its own SDL.
    4.16 -- Even if we replace the SDL2 in those games with a compatible one, that is to 
    4.17 -  say, edit a developer's Steam depot (yuck!), there are developers that are 
    4.18 -  statically linking SDL2 that we can't do this for. We can't even force the 
    4.19 -  dynamic loader to ignore their SDL2 in this case, of course.
    4.20 -- If you don't ship an SDL2 with the game in some form, people that disabled the
    4.21 -  Steam Runtime, or just tried to run the game from the command line instead of 
    4.22 -  Steam might find themselves unable to run the game, due to a missing dependency.
    4.23 -- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
    4.24 -  generic Linux boxes that may or may not have SDL2 installed, you have to ship 
    4.25 -  the library or risk a total failure to launch. So now, you might have to have 
    4.26 -  a non-Steam build plus a Steam build (that is, one with and one without SDL2 
    4.27 -  included), which is inconvenient if you could have had one universal build 
    4.28 -  that works everywhere.
    4.29 -- We like the zlib license, but the biggest complaint from the open source 
    4.30 -  community about the license change is the static linking. The LGPL forced this 
    4.31 -  as a legal, not technical issue, but zlib doesn't care. Even those that aren't
    4.32 -  concerned about the GNU freedoms found themselves solving the same problems: 
    4.33 -  swapping in a newer SDL to an older game often times can save the day. 
    4.34 -  Static linking stops this dead.
    4.35 -
    4.36 -So here's what we did:
    4.37 -
    4.38 -SDL now has, internally, a table of function pointers. So, this is what SDL_Init
    4.39 -now looks like:
    4.40 -
    4.41 -    UInt32 SDL_Init(Uint32 flags)
    4.42 -    {
    4.43 -        return jump_table.SDL_Init(flags);
    4.44 -    }
    4.45 -
    4.46 -Except that is all done with a bunch of macro magic so we don't have to maintain
    4.47 -every one of these.
    4.48 -
    4.49 -What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
    4.50 -SDL_Init() that you've been calling all this time. But at startup, it looks more 
    4.51 -like this:
    4.52 -
    4.53 -    Uint32 SDL_Init_DEFAULT(Uint32 flags)
    4.54 -    {
    4.55 -        SDL_InitDynamicAPI();
    4.56 -        return jump_table.SDL_Init(flags);
    4.57 -    }
    4.58 -
    4.59 -SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function 
    4.60 -pointers, which means that this _DEFAULT function never gets called again. 
    4.61 -First call to any SDL function sets the whole thing up.
    4.62 -
    4.63 -So you might be asking, what was the value in that? Isn't this what the operating
    4.64 -system's dynamic loader was supposed to do for us? Yes, but now we've got this 
    4.65 -level of indirection, we can do things like this:
    4.66 -
    4.67 -    export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
    4.68 -    ./MyGameThatIsStaticallyLinkedToSDL2
    4.69 -
    4.70 -And now, this game that is staticallly linked to SDL, can still be overridden 
    4.71 -with a newer, or better, SDL. The statically linked one will only be used as 
    4.72 -far as calling into the jump table in this case. But in cases where no override
    4.73 -is desired, the statically linked version will provide its own jump table, 
    4.74 -and everyone is happy.
    4.75 -
    4.76 -So now:
    4.77 -- Developers can statically link SDL, and users can still replace it. 
    4.78 -  (We'd still rather you ship a shared library, though!)
    4.79 -- Developers can ship an SDL with their game, Valve can override it for, say, 
    4.80 -  new features on SteamOS, or distros can override it for their own needs, 
    4.81 -  but it'll also just work in the default case.
    4.82 -- Developers can ship the same package to everyone (Humble Bundle, GOG, etc), 
    4.83 -  and it'll do the right thing.
    4.84 -- End users (and Valve) can update a game's SDL in almost any case, 
    4.85 -  to keep abandoned games running on newer platforms.
    4.86 -- Everyone develops with SDL exactly as they have been doing all along. 
    4.87 -  Same headers, same ABI. Just get the latest version to enable this magic.
    4.88 -
    4.89 -
    4.90 -A little more about SDL_InitDynamicAPI():
    4.91 -
    4.92 -Internally, InitAPI does some locking to make sure everything waits until a 
    4.93 -single thread initializes everything (although even SDL_CreateThread() goes 
    4.94 -through here before spinning a thread, too), and then decides if it should use
    4.95 -an external SDL library. If not, it sets up the jump table using the current 
    4.96 -SDL's function pointers (which might be statically linked into a program, or in
    4.97 -a shared library of its own). If so, it loads that library and looks for and 
    4.98 -calls a single function:
    4.99 -
   4.100 -    SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
   4.101 -
   4.102 -That function takes a version number (more on that in a moment), the address of
   4.103 -the jump table, and the size, in bytes, of the table. 
   4.104 -Now, we've got policy here: this table's layout never changes; new stuff gets 
   4.105 -added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all 
   4.106 -the needed functions if tablesize <= sizeof its own jump table. If tablesize is
   4.107 -bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
   4.108 -if it's smaller, we know we can provide the entire API that the caller needs.
   4.109 -
   4.110 -The version variable is a failsafe switch. 
   4.111 -Right now it's always 1. This number changes when there are major API changes 
   4.112 -(so we know if the tablesize might be smaller, or entries in it have changed). 
   4.113 -Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not 
   4.114 -inconceivable to have a small dispatch library that only supplies this one 
   4.115 -function and loads different, otherwise-incompatible SDL libraries and has the
   4.116 -right one initialize the jump table based on the version. For something that 
   4.117 -must generically catch lots of different versions of SDL over time, like the 
   4.118 -Steam Client, this isn't a bad option.
   4.119 -
   4.120 -Finally, I'm sure some people are reading this and thinking,
   4.121 -"I don't want that overhead in my project!"  
   4.122 -To which I would point out that the extra function call through the jump table 
   4.123 -probably wouldn't even show up in a profile, but lucky you: this can all be 
   4.124 -disabled. You can build SDL without this if you absolutely must, but we would 
   4.125 -encourage you not to do that. However, on heavily locked down platforms like 
   4.126 -iOS, or maybe when debugging, it makes sense to disable it. The way this is
   4.127 -designed in SDL, you just have to change one #define, and the entire system 
   4.128 -vaporizes out, and SDL functions exactly like it always did. Most of it is 
   4.129 -macro magic, so the system is contained to one C file and a few headers. 
   4.130 -However, this is on by default and you have to edit a header file to turn it 
   4.131 -off. Our hopes is that if we make it easy to disable, but not too easy, 
   4.132 -everyone will ultimately be able to get what they want, but we've gently 
   4.133 -nudged everyone towards what we think is the best solution.
   4.134 +Dynamic API
   4.135 +================================================================================
   4.136 +Originally posted by Ryan at:
   4.137 +  https://plus.google.com/103391075724026391227/posts/TB8UfnDYu4U
   4.138 +
   4.139 +Background:
   4.140 +
   4.141 +- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2, 
   4.142 +  but developers are shipping their own SDL2 with individual Steam games. 
   4.143 +  These games might stop getting updates, but a newer SDL2 might be needed later. 
   4.144 +  Certainly we'll always be fixing bugs in SDL, even if a new video target isn't 
   4.145 +  ever needed, and these fixes won't make it to a game shipping its own SDL.
   4.146 +- Even if we replace the SDL2 in those games with a compatible one, that is to 
   4.147 +  say, edit a developer's Steam depot (yuck!), there are developers that are 
   4.148 +  statically linking SDL2 that we can't do this for. We can't even force the 
   4.149 +  dynamic loader to ignore their SDL2 in this case, of course.
   4.150 +- If you don't ship an SDL2 with the game in some form, people that disabled the
   4.151 +  Steam Runtime, or just tried to run the game from the command line instead of 
   4.152 +  Steam might find themselves unable to run the game, due to a missing dependency.
   4.153 +- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
   4.154 +  generic Linux boxes that may or may not have SDL2 installed, you have to ship 
   4.155 +  the library or risk a total failure to launch. So now, you might have to have 
   4.156 +  a non-Steam build plus a Steam build (that is, one with and one without SDL2 
   4.157 +  included), which is inconvenient if you could have had one universal build 
   4.158 +  that works everywhere.
   4.159 +- We like the zlib license, but the biggest complaint from the open source 
   4.160 +  community about the license change is the static linking. The LGPL forced this 
   4.161 +  as a legal, not technical issue, but zlib doesn't care. Even those that aren't
   4.162 +  concerned about the GNU freedoms found themselves solving the same problems: 
   4.163 +  swapping in a newer SDL to an older game often times can save the day. 
   4.164 +  Static linking stops this dead.
   4.165 +
   4.166 +So here's what we did:
   4.167 +
   4.168 +SDL now has, internally, a table of function pointers. So, this is what SDL_Init
   4.169 +now looks like:
   4.170 +
   4.171 +    UInt32 SDL_Init(Uint32 flags)
   4.172 +    {
   4.173 +        return jump_table.SDL_Init(flags);
   4.174 +    }
   4.175 +
   4.176 +Except that is all done with a bunch of macro magic so we don't have to maintain
   4.177 +every one of these.
   4.178 +
   4.179 +What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
   4.180 +SDL_Init() that you've been calling all this time. But at startup, it looks more 
   4.181 +like this:
   4.182 +
   4.183 +    Uint32 SDL_Init_DEFAULT(Uint32 flags)
   4.184 +    {
   4.185 +        SDL_InitDynamicAPI();
   4.186 +        return jump_table.SDL_Init(flags);
   4.187 +    }
   4.188 +
   4.189 +SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function 
   4.190 +pointers, which means that this _DEFAULT function never gets called again. 
   4.191 +First call to any SDL function sets the whole thing up.
   4.192 +
   4.193 +So you might be asking, what was the value in that? Isn't this what the operating
   4.194 +system's dynamic loader was supposed to do for us? Yes, but now we've got this 
   4.195 +level of indirection, we can do things like this:
   4.196 +
   4.197 +    export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
   4.198 +    ./MyGameThatIsStaticallyLinkedToSDL2
   4.199 +
   4.200 +And now, this game that is staticallly linked to SDL, can still be overridden 
   4.201 +with a newer, or better, SDL. The statically linked one will only be used as 
   4.202 +far as calling into the jump table in this case. But in cases where no override
   4.203 +is desired, the statically linked version will provide its own jump table, 
   4.204 +and everyone is happy.
   4.205 +
   4.206 +So now:
   4.207 +- Developers can statically link SDL, and users can still replace it. 
   4.208 +  (We'd still rather you ship a shared library, though!)
   4.209 +- Developers can ship an SDL with their game, Valve can override it for, say, 
   4.210 +  new features on SteamOS, or distros can override it for their own needs, 
   4.211 +  but it'll also just work in the default case.
   4.212 +- Developers can ship the same package to everyone (Humble Bundle, GOG, etc), 
   4.213 +  and it'll do the right thing.
   4.214 +- End users (and Valve) can update a game's SDL in almost any case, 
   4.215 +  to keep abandoned games running on newer platforms.
   4.216 +- Everyone develops with SDL exactly as they have been doing all along. 
   4.217 +  Same headers, same ABI. Just get the latest version to enable this magic.
   4.218 +
   4.219 +
   4.220 +A little more about SDL_InitDynamicAPI():
   4.221 +
   4.222 +Internally, InitAPI does some locking to make sure everything waits until a 
   4.223 +single thread initializes everything (although even SDL_CreateThread() goes 
   4.224 +through here before spinning a thread, too), and then decides if it should use
   4.225 +an external SDL library. If not, it sets up the jump table using the current 
   4.226 +SDL's function pointers (which might be statically linked into a program, or in
   4.227 +a shared library of its own). If so, it loads that library and looks for and 
   4.228 +calls a single function:
   4.229 +
   4.230 +    SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
   4.231 +
   4.232 +That function takes a version number (more on that in a moment), the address of
   4.233 +the jump table, and the size, in bytes, of the table. 
   4.234 +Now, we've got policy here: this table's layout never changes; new stuff gets 
   4.235 +added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all 
   4.236 +the needed functions if tablesize <= sizeof its own jump table. If tablesize is
   4.237 +bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
   4.238 +if it's smaller, we know we can provide the entire API that the caller needs.
   4.239 +
   4.240 +The version variable is a failsafe switch. 
   4.241 +Right now it's always 1. This number changes when there are major API changes 
   4.242 +(so we know if the tablesize might be smaller, or entries in it have changed). 
   4.243 +Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not 
   4.244 +inconceivable to have a small dispatch library that only supplies this one 
   4.245 +function and loads different, otherwise-incompatible SDL libraries and has the
   4.246 +right one initialize the jump table based on the version. For something that 
   4.247 +must generically catch lots of different versions of SDL over time, like the 
   4.248 +Steam Client, this isn't a bad option.
   4.249 +
   4.250 +Finally, I'm sure some people are reading this and thinking,
   4.251 +"I don't want that overhead in my project!"  
   4.252 +To which I would point out that the extra function call through the jump table 
   4.253 +probably wouldn't even show up in a profile, but lucky you: this can all be 
   4.254 +disabled. You can build SDL without this if you absolutely must, but we would 
   4.255 +encourage you not to do that. However, on heavily locked down platforms like 
   4.256 +iOS, or maybe when debugging, it makes sense to disable it. The way this is
   4.257 +designed in SDL, you just have to change one #define, and the entire system 
   4.258 +vaporizes out, and SDL functions exactly like it always did. Most of it is 
   4.259 +macro magic, so the system is contained to one C file and a few headers. 
   4.260 +However, this is on by default and you have to edit a header file to turn it 
   4.261 +off. Our hopes is that if we make it easy to disable, but not too easy, 
   4.262 +everyone will ultimately be able to get what they want, but we've gently 
   4.263 +nudged everyone towards what we think is the best solution.
     5.1 --- a/docs/README-emscripten.md	Fri Oct 07 17:30:21 2016 -0700
     5.2 +++ b/docs/README-emscripten.md	Fri Oct 07 17:46:58 2016 -0700
     5.3 @@ -1,37 +1,37 @@
     5.4 -Emscripten
     5.5 -================================================================================
     5.6 -
     5.7 -Build:
     5.8 -
     5.9 -    $ mkdir build
    5.10 -    $ cd build
    5.11 -    $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
    5.12 -    $ emmake make
    5.13 -
    5.14 -Or with cmake:
    5.15 -
    5.16 -    $ mkdir build
    5.17 -    $ cd build
    5.18 -    $ emcmake cmake ..
    5.19 -    $ emmake make
    5.20 -
    5.21 -To build one of the tests:
    5.22 -
    5.23 -    $ cd test/
    5.24 -    $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
    5.25 -
    5.26 -Uses GLES2 renderer or software
    5.27 -
    5.28 -tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
    5.29 -
    5.30 -Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
    5.31 -
    5.32 -SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
    5.33 -
    5.34 -    $ EMCONFIGURE_JS=1 emconfigure ../configure
    5.35 -    build as usual...
    5.36 -
    5.37 -SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
    5.38 -
    5.39 -    $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
    5.40 -    build as usual...
    5.41 +Emscripten
    5.42 +================================================================================
    5.43 +
    5.44 +Build:
    5.45 +
    5.46 +    $ mkdir build
    5.47 +    $ cd build
    5.48 +    $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
    5.49 +    $ emmake make
    5.50 +
    5.51 +Or with cmake:
    5.52 +
    5.53 +    $ mkdir build
    5.54 +    $ cd build
    5.55 +    $ emcmake cmake ..
    5.56 +    $ emmake make
    5.57 +
    5.58 +To build one of the tests:
    5.59 +
    5.60 +    $ cd test/
    5.61 +    $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
    5.62 +
    5.63 +Uses GLES2 renderer or software
    5.64 +
    5.65 +tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
    5.66 +
    5.67 +Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
    5.68 +
    5.69 +SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
    5.70 +
    5.71 +    $ EMCONFIGURE_JS=1 emconfigure ../configure
    5.72 +    build as usual...
    5.73 +
    5.74 +SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
    5.75 +
    5.76 +    $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
    5.77 +    build as usual...
     6.1 --- a/docs/README-hg.md	Fri Oct 07 17:30:21 2016 -0700
     6.2 +++ b/docs/README-hg.md	Fri Oct 07 17:46:58 2016 -0700
     6.3 @@ -1,6 +1,6 @@
     6.4 -Mercurial
     6.5 -=========
     6.6 -
     6.7 +Mercurial
     6.8 +=========
     6.9 +
    6.10  The latest development version of SDL is available via Mercurial.
    6.11  Mercurial allows you to get up-to-the-minute fixes and enhancements;
    6.12  as a developer works on a source tree, you can use "hg" to mirror that
     7.1 --- a/docs/README-linux.md	Fri Oct 07 17:30:21 2016 -0700
     7.2 +++ b/docs/README-linux.md	Fri Oct 07 17:46:58 2016 -0700
     7.3 @@ -1,85 +1,85 @@
     7.4 -Linux
     7.5 -================================================================================
     7.6 -
     7.7 -By default SDL will only link against glibc, the rest of the features will be
     7.8 -enabled dynamically at runtime depending on the available features on the target
     7.9 -system. So, for example if you built SDL with Xinerama support and the target
    7.10 -system does not have the Xinerama libraries installed, it will be disabled
    7.11 -at runtime, and you won't get a missing library error, at least with the 
    7.12 -default configuration parameters.
    7.13 -
    7.14 -
    7.15 -================================================================================
    7.16 -Build Dependencies
    7.17 -================================================================================
    7.18 -    
    7.19 -Ubuntu 13.04, all available features enabled:
    7.20 -
    7.21 -sudo apt-get install build-essential mercurial make cmake autoconf automake \
    7.22 -libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
    7.23 -libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
    7.24 -libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
    7.25 -libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev
    7.26 -
    7.27 -Ubuntu 16.04 can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
    7.28 -to that command line for Wayland support.
    7.29 -
    7.30 -Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
    7.31 -line for Mir support.
    7.32 -
    7.33 -NOTES:
    7.34 -- This includes all the audio targets except arts, because Ubuntu pulled the 
    7.35 -  artsc0-dev package, but in theory SDL still supports it.
    7.36 -- DirectFB isn't included because the configure script (currently) fails to find
    7.37 -  it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the 
    7.38 -  configure script to include DirectFB support. Send patches.  :)
    7.39 -
    7.40 -
    7.41 -================================================================================
    7.42 -Joystick does not work
    7.43 -================================================================================
    7.44 -
    7.45 -If you compiled or are using a version of SDL with udev support (and you should!)
    7.46 -there's a few issues that may cause SDL to fail to detect your joystick. To
    7.47 -debug this, start by installing the evtest utility. On Ubuntu/Debian:
    7.48 -
    7.49 -    sudo apt-get install evtest
    7.50 -    
    7.51 -Then run:
    7.52 -    
    7.53 -    sudo evtest
    7.54 -    
    7.55 -You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
    7.56 -Now run:
    7.57 -    
    7.58 -    cat /dev/input/event/XX
    7.59 -
    7.60 -If you get a permission error, you need to set a udev rule to change the mode of
    7.61 -your device (see below)    
    7.62 -    
    7.63 -Also, try:
    7.64 -    
    7.65 -    sudo udevadm info --query=all --name=input/eventXX
    7.66 -    
    7.67 -If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
    7.68 -you need to set up an udev rule to force this variable.
    7.69 -
    7.70 -A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks 
    7.71 -like:
    7.72 -    
    7.73 -   SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
    7.74 -   SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
    7.75 -   
    7.76 -You can set up similar rules for your device by changing the values listed in
    7.77 -idProduct and idVendor. To obtain these values, try:
    7.78 -    
    7.79 -    sudo udevadm info -a --name=input/eventXX | grep idVendor
    7.80 -    sudo udevadm info -a --name=input/eventXX | grep idProduct
    7.81 -    
    7.82 -If multiple values come up for each of these, the one you want is the first one of each.    
    7.83 -
    7.84 -On other systems which ship with an older udev (such as CentOS), you may need
    7.85 -to set up a rule such as:
    7.86 -    
    7.87 -    SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
    7.88 -
    7.89 +Linux
    7.90 +================================================================================
    7.91 +
    7.92 +By default SDL will only link against glibc, the rest of the features will be
    7.93 +enabled dynamically at runtime depending on the available features on the target
    7.94 +system. So, for example if you built SDL with Xinerama support and the target
    7.95 +system does not have the Xinerama libraries installed, it will be disabled
    7.96 +at runtime, and you won't get a missing library error, at least with the 
    7.97 +default configuration parameters.
    7.98 +
    7.99 +
   7.100 +================================================================================
   7.101 +Build Dependencies
   7.102 +================================================================================
   7.103 +    
   7.104 +Ubuntu 13.04, all available features enabled:
   7.105 +
   7.106 +sudo apt-get install build-essential mercurial make cmake autoconf automake \
   7.107 +libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
   7.108 +libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
   7.109 +libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
   7.110 +libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev
   7.111 +
   7.112 +Ubuntu 16.04 can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
   7.113 +to that command line for Wayland support.
   7.114 +
   7.115 +Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
   7.116 +line for Mir support.
   7.117 +
   7.118 +NOTES:
   7.119 +- This includes all the audio targets except arts, because Ubuntu pulled the 
   7.120 +  artsc0-dev package, but in theory SDL still supports it.
   7.121 +- DirectFB isn't included because the configure script (currently) fails to find
   7.122 +  it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the 
   7.123 +  configure script to include DirectFB support. Send patches.  :)
   7.124 +
   7.125 +
   7.126 +================================================================================
   7.127 +Joystick does not work
   7.128 +================================================================================
   7.129 +
   7.130 +If you compiled or are using a version of SDL with udev support (and you should!)
   7.131 +there's a few issues that may cause SDL to fail to detect your joystick. To
   7.132 +debug this, start by installing the evtest utility. On Ubuntu/Debian:
   7.133 +
   7.134 +    sudo apt-get install evtest
   7.135 +    
   7.136 +Then run:
   7.137 +    
   7.138 +    sudo evtest
   7.139 +    
   7.140 +You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
   7.141 +Now run:
   7.142 +    
   7.143 +    cat /dev/input/event/XX
   7.144 +
   7.145 +If you get a permission error, you need to set a udev rule to change the mode of
   7.146 +your device (see below)    
   7.147 +    
   7.148 +Also, try:
   7.149 +    
   7.150 +    sudo udevadm info --query=all --name=input/eventXX
   7.151 +    
   7.152 +If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
   7.153 +you need to set up an udev rule to force this variable.
   7.154 +
   7.155 +A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks 
   7.156 +like:
   7.157 +    
   7.158 +   SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
   7.159 +   SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
   7.160 +   
   7.161 +You can set up similar rules for your device by changing the values listed in
   7.162 +idProduct and idVendor. To obtain these values, try:
   7.163 +    
   7.164 +    sudo udevadm info -a --name=input/eventXX | grep idVendor
   7.165 +    sudo udevadm info -a --name=input/eventXX | grep idProduct
   7.166 +    
   7.167 +If multiple values come up for each of these, the one you want is the first one of each.    
   7.168 +
   7.169 +On other systems which ship with an older udev (such as CentOS), you may need
   7.170 +to set up a rule such as:
   7.171 +    
   7.172 +    SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
   7.173 +
     8.1 --- a/docs/README-nacl.md	Fri Oct 07 17:30:21 2016 -0700
     8.2 +++ b/docs/README-nacl.md	Fri Oct 07 17:46:58 2016 -0700
     8.3 @@ -1,103 +1,103 @@
     8.4 -Native Client
     8.5 -================================================================================
     8.6 -
     8.7 -Requirements: 
     8.8 -
     8.9 -* Native Client SDK (https://developer.chrome.com/native-client), 
    8.10 -  (tested with Pepper version 33 or higher).
    8.11 -
    8.12 -The SDL backend for Chrome's Native Client has been tested only with the PNaCl
    8.13 -toolchain, which generates binaries designed to run on ARM and x86_32/64 
    8.14 -platforms. This does not mean it won't work with the other toolchains!
    8.15 -
    8.16 -================================================================================
    8.17 -Building SDL for NaCl
    8.18 -================================================================================
    8.19 -
    8.20 -Set up the right environment variables (see naclbuild.sh), then configure SDL with:
    8.21 -
    8.22 -    configure --host=pnacl --prefix some/install/destination
    8.23 -    
    8.24 -Then "make". 
    8.25 -
    8.26 -As an example of how to create a deployable app a Makefile project is provided 
    8.27 -in test/nacl/Makefile, which includes some monkey patching of the common.mk file 
    8.28 -provided by NaCl, without which linking properly to SDL won't work (the search 
    8.29 -path can't be modified externally, so the linker won't find SDL's binaries unless 
    8.30 -you dump them into the SDK path, which is inconvenient).
    8.31 -Also provided in test/nacl is the required support file, such as index.html, 
    8.32 -manifest.json, etc.
    8.33 -SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
    8.34 -This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
    8.35 -hiding the asynchronous nature of the browser behind the scenes...which is not the
    8.36 -same as making it disappear!
    8.37 -
    8.38 -
    8.39 -================================================================================
    8.40 -Running tests
    8.41 -================================================================================
    8.42 -
    8.43 -Due to the nature of NaCl programs, building and running SDL tests is not as
    8.44 -straightforward as one would hope. The script naclbuild.sh in build-scripts 
    8.45 -automates the process and should serve as a guide for users of SDL trying to build 
    8.46 -their own applications.
    8.47 -
    8.48 -Basic usage:
    8.49 -    
    8.50 -    ./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
    8.51 -    
    8.52 -This will build testgles2.c by default.
    8.53 -
    8.54 -If you want to build a different test, for example testrendercopyex.c:
    8.55 -    
    8.56 -    SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
    8.57 -    
    8.58 -Once the build finishes, you have to serve the contents with a web server (the
    8.59 -script will give you instructions on how to do that with Python).
    8.60 -
    8.61 -================================================================================
    8.62 -RWops and nacl_io
    8.63 -================================================================================
    8.64 -
    8.65 -SDL_RWops work transparently with nacl_io. Two functions control the mount points:
    8.66 -    
    8.67 -    int mount(const char* source, const char* target, 
    8.68 -                      const char* filesystemtype, 
    8.69 -                      unsigned long mountflags, const void *data);
    8.70 -    int umount(const char *target);
    8.71 -    
    8.72 -    For convenience, SDL will by default mount an httpfs tree at / before calling 
    8.73 -the app's main function. Such setting can be overridden by calling:
    8.74 -    
    8.75 -    umount("/");
    8.76 -
    8.77 -And then mounting a different filesystem at /
    8.78 -
    8.79 -It's important to consider that the asynchronous nature of file operations on a
    8.80 -browser is hidden from the application, effectively providing the developer with
    8.81 -a set of blocking file operations just like you get in a regular desktop 
    8.82 -environment, which eases the job of porting to Native Client, but also introduces 
    8.83 -a set of challenges of its own, in particular when big file sizes and slow 
    8.84 -connections are involved.
    8.85 -
    8.86 -For more information on how nacl_io and mount points work, see:
    8.87 -    
    8.88 -    https://developer.chrome.com/native-client/devguide/coding/nacl_io
    8.89 -    https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
    8.90 -
    8.91 -To be able to save into the directory "/save/" (like backup of game) :
    8.92 -
    8.93 -    mount("", "/save", "html5fs", 0, "type=PERSISTENT");
    8.94 -
    8.95 -And add to manifest.json :
    8.96 -
    8.97 -    "permissions": [
    8.98 -        "unlimitedStorage"
    8.99 -    ]
   8.100 -
   8.101 -================================================================================
   8.102 -TODO - Known Issues
   8.103 -================================================================================
   8.104 -* Testing of all systems with a real application (something other than SDL's tests)
   8.105 -* Key events don't seem to work properly
   8.106 -
   8.107 +Native Client
   8.108 +================================================================================
   8.109 +
   8.110 +Requirements: 
   8.111 +
   8.112 +* Native Client SDK (https://developer.chrome.com/native-client), 
   8.113 +  (tested with Pepper version 33 or higher).
   8.114 +
   8.115 +The SDL backend for Chrome's Native Client has been tested only with the PNaCl
   8.116 +toolchain, which generates binaries designed to run on ARM and x86_32/64 
   8.117 +platforms. This does not mean it won't work with the other toolchains!
   8.118 +
   8.119 +================================================================================
   8.120 +Building SDL for NaCl
   8.121 +================================================================================
   8.122 +
   8.123 +Set up the right environment variables (see naclbuild.sh), then configure SDL with:
   8.124 +
   8.125 +    configure --host=pnacl --prefix some/install/destination
   8.126 +    
   8.127 +Then "make". 
   8.128 +
   8.129 +As an example of how to create a deployable app a Makefile project is provided 
   8.130 +in test/nacl/Makefile, which includes some monkey patching of the common.mk file 
   8.131 +provided by NaCl, without which linking properly to SDL won't work (the search 
   8.132 +path can't be modified externally, so the linker won't find SDL's binaries unless 
   8.133 +you dump them into the SDK path, which is inconvenient).
   8.134 +Also provided in test/nacl is the required support file, such as index.html, 
   8.135 +manifest.json, etc.
   8.136 +SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
   8.137 +This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
   8.138 +hiding the asynchronous nature of the browser behind the scenes...which is not the
   8.139 +same as making it disappear!
   8.140 +
   8.141 +
   8.142 +================================================================================
   8.143 +Running tests
   8.144 +================================================================================
   8.145 +
   8.146 +Due to the nature of NaCl programs, building and running SDL tests is not as
   8.147 +straightforward as one would hope. The script naclbuild.sh in build-scripts 
   8.148 +automates the process and should serve as a guide for users of SDL trying to build 
   8.149 +their own applications.
   8.150 +
   8.151 +Basic usage:
   8.152 +    
   8.153 +    ./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
   8.154 +    
   8.155 +This will build testgles2.c by default.
   8.156 +
   8.157 +If you want to build a different test, for example testrendercopyex.c:
   8.158 +    
   8.159 +    SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
   8.160 +    
   8.161 +Once the build finishes, you have to serve the contents with a web server (the
   8.162 +script will give you instructions on how to do that with Python).
   8.163 +
   8.164 +================================================================================
   8.165 +RWops and nacl_io
   8.166 +================================================================================
   8.167 +
   8.168 +SDL_RWops work transparently with nacl_io. Two functions control the mount points:
   8.169 +    
   8.170 +    int mount(const char* source, const char* target, 
   8.171 +                      const char* filesystemtype, 
   8.172 +                      unsigned long mountflags, const void *data);
   8.173 +    int umount(const char *target);
   8.174 +    
   8.175 +    For convenience, SDL will by default mount an httpfs tree at / before calling 
   8.176 +the app's main function. Such setting can be overridden by calling:
   8.177 +    
   8.178 +    umount("/");
   8.179 +
   8.180 +And then mounting a different filesystem at /
   8.181 +
   8.182 +It's important to consider that the asynchronous nature of file operations on a
   8.183 +browser is hidden from the application, effectively providing the developer with
   8.184 +a set of blocking file operations just like you get in a regular desktop 
   8.185 +environment, which eases the job of porting to Native Client, but also introduces 
   8.186 +a set of challenges of its own, in particular when big file sizes and slow 
   8.187 +connections are involved.
   8.188 +
   8.189 +For more information on how nacl_io and mount points work, see:
   8.190 +    
   8.191 +    https://developer.chrome.com/native-client/devguide/coding/nacl_io
   8.192 +    https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
   8.193 +
   8.194 +To be able to save into the directory "/save/" (like backup of game) :
   8.195 +
   8.196 +    mount("", "/save", "html5fs", 0, "type=PERSISTENT");
   8.197 +
   8.198 +And add to manifest.json :
   8.199 +
   8.200 +    "permissions": [
   8.201 +        "unlimitedStorage"
   8.202 +    ]
   8.203 +
   8.204 +================================================================================
   8.205 +TODO - Known Issues
   8.206 +================================================================================
   8.207 +* Testing of all systems with a real application (something other than SDL's tests)
   8.208 +* Key events don't seem to work properly
   8.209 +
     9.1 --- a/docs/README-pandora.md	Fri Oct 07 17:30:21 2016 -0700
     9.2 +++ b/docs/README-pandora.md	Fri Oct 07 17:46:58 2016 -0700
     9.3 @@ -1,7 +1,7 @@
     9.4 -Pandora 
     9.5 +Pandora 
     9.6  =====================================================================
     9.7 -
     9.8 -( http://openpandora.org/ )
     9.9 +
    9.10 +( http://openpandora.org/ )
    9.11  - A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
    9.12  support to work on the pandora under the framebuffer. This driver do not have
    9.13  input support for now, so if you use it you will have to add your own control code.
    10.1 --- a/docs/README-platforms.md	Fri Oct 07 17:30:21 2016 -0700
    10.2 +++ b/docs/README-platforms.md	Fri Oct 07 17:46:58 2016 -0700
    10.3 @@ -1,8 +1,8 @@
    10.4 -Platforms
    10.5 -=========
    10.6 -
    10.7 -We maintain the list of supported platforms on our wiki now, and how to
    10.8 -build and install SDL for those platforms:
    10.9 -
   10.10 -    https://wiki.libsdl.org/Installation
   10.11 -
   10.12 +Platforms
   10.13 +=========
   10.14 +
   10.15 +We maintain the list of supported platforms on our wiki now, and how to
   10.16 +build and install SDL for those platforms:
   10.17 +
   10.18 +    https://wiki.libsdl.org/Installation
   10.19 +
    11.1 --- a/docs/README-psp.md	Fri Oct 07 17:30:21 2016 -0700
    11.2 +++ b/docs/README-psp.md	Fri Oct 07 17:46:58 2016 -0700
    11.3 @@ -1,5 +1,5 @@
    11.4 -PSP
    11.5 -======
    11.6 +PSP
    11.7 +======
    11.8  SDL port for the Sony PSP contributed by 
    11.9     Captian Lex 
   11.10  
    12.1 --- a/docs/README-touch.md	Fri Oct 07 17:30:21 2016 -0700
    12.2 +++ b/docs/README-touch.md	Fri Oct 07 17:46:58 2016 -0700
    12.3 @@ -1,4 +1,4 @@
    12.4 -Touch
    12.5 +Touch
    12.6  ===========================================================================
    12.7  System Specific Notes
    12.8  ===========================================================================
    13.1 --- a/docs/README-wince.md	Fri Oct 07 17:30:21 2016 -0700
    13.2 +++ b/docs/README-wince.md	Fri Oct 07 17:46:58 2016 -0700
    13.3 @@ -1,5 +1,5 @@
    13.4 -WinCE
    13.5 -=====
    13.6 +WinCE
    13.7 +=====
    13.8  
    13.9  Windows CE is no longer supported by SDL.
   13.10  
    14.1 --- a/docs/README-windows.md	Fri Oct 07 17:30:21 2016 -0700
    14.2 +++ b/docs/README-windows.md	Fri Oct 07 17:46:58 2016 -0700
    14.3 @@ -1,41 +1,41 @@
    14.4 -Windows
    14.5 -================================================================================
    14.6 -
    14.7 -================================================================================
    14.8 -OpenGL ES 2.x support
    14.9 -================================================================================
   14.10 -
   14.11 -SDL has support for OpenGL ES 2.x under Windows via two alternative 
   14.12 -implementations. 
   14.13 -The most straightforward method consists in running your app in a system with 
   14.14 -a graphic card paired with a relatively recent (as of November of 2013) driver 
   14.15 -which supports the WGL_EXT_create_context_es2_profile extension. Vendors known 
   14.16 -to ship said extension on Windows currently include nVidia and Intel.
   14.17 -
   14.18 -The other method involves using the ANGLE library (https://code.google.com/p/angleproject/)
   14.19 -If an OpenGL ES 2.x context is requested and no WGL_EXT_create_context_es2_profile
   14.20 -extension is found, SDL will try to load the libEGL.dll library provided by
   14.21 -ANGLE.
   14.22 -To obtain the ANGLE binaries, you can either compile from source from
   14.23 -https://chromium.googlesource.com/angle/angle or copy the relevant binaries from
   14.24 -a recent Chrome/Chromium install for Windows. The files you need are:
   14.25 -    
   14.26 -    * libEGL.dll
   14.27 -    * libGLESv2.dll
   14.28 -    * d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler)
   14.29 -    or...
   14.30 -    * d3dcompiler_43.dll (supports Windows XP or later)
   14.31 -    
   14.32 -If you compile ANGLE from source, you can configure it so it does not need the
   14.33 -d3dcompiler_* DLL at all (for details on this, see their documentation). 
   14.34 -However, by default SDL will try to preload the d3dcompiler_46.dll to
   14.35 -comply with ANGLE's requirements. If you wish SDL to preload d3dcompiler_43.dll (to
   14.36 -support Windows XP) or to skip this step at all, you can use the 
   14.37 -SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more details).
   14.38 -
   14.39 -Known Bugs:
   14.40 -    
   14.41 -    * SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears
   14.42 -      that there's a bug in the library which prevents the window contents from
   14.43 -      refreshing if this is set to anything other than the default value.
   14.44 -      
   14.45 +Windows
   14.46 +================================================================================
   14.47 +
   14.48 +================================================================================
   14.49 +OpenGL ES 2.x support
   14.50 +================================================================================
   14.51 +
   14.52 +SDL has support for OpenGL ES 2.x under Windows via two alternative 
   14.53 +implementations. 
   14.54 +The most straightforward method consists in running your app in a system with 
   14.55 +a graphic card paired with a relatively recent (as of November of 2013) driver 
   14.56 +which supports the WGL_EXT_create_context_es2_profile extension. Vendors known 
   14.57 +to ship said extension on Windows currently include nVidia and Intel.
   14.58 +
   14.59 +The other method involves using the ANGLE library (https://code.google.com/p/angleproject/)
   14.60 +If an OpenGL ES 2.x context is requested and no WGL_EXT_create_context_es2_profile
   14.61 +extension is found, SDL will try to load the libEGL.dll library provided by
   14.62 +ANGLE.
   14.63 +To obtain the ANGLE binaries, you can either compile from source from
   14.64 +https://chromium.googlesource.com/angle/angle or copy the relevant binaries from
   14.65 +a recent Chrome/Chromium install for Windows. The files you need are:
   14.66 +    
   14.67 +    * libEGL.dll
   14.68 +    * libGLESv2.dll
   14.69 +    * d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler)
   14.70 +    or...
   14.71 +    * d3dcompiler_43.dll (supports Windows XP or later)
   14.72 +    
   14.73 +If you compile ANGLE from source, you can configure it so it does not need the
   14.74 +d3dcompiler_* DLL at all (for details on this, see their documentation). 
   14.75 +However, by default SDL will try to preload the d3dcompiler_46.dll to
   14.76 +comply with ANGLE's requirements. If you wish SDL to preload d3dcompiler_43.dll (to
   14.77 +support Windows XP) or to skip this step at all, you can use the 
   14.78 +SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more details).
   14.79 +
   14.80 +Known Bugs:
   14.81 +    
   14.82 +    * SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears
   14.83 +      that there's a bug in the library which prevents the window contents from
   14.84 +      refreshing if this is set to anything other than the default value.
   14.85 +      
    15.1 --- a/docs/README-winrt.md	Fri Oct 07 17:30:21 2016 -0700
    15.2 +++ b/docs/README-winrt.md	Fri Oct 07 17:46:58 2016 -0700
    15.3 @@ -1,478 +1,478 @@
    15.4 -WinRT
    15.5 -=====
    15.6 -
    15.7 -This port allows SDL applications to run on Microsoft's platforms that require
    15.8 -use of "Windows Runtime", aka. "WinRT", APIs.  Microsoft may, in some cases,
    15.9 -refer to them as either "Windows Store", or for Windows 10, "UWP" apps.
   15.10 -
   15.11 -Some of the operating systems that include WinRT, are:
   15.12 -
   15.13 -* Windows 10, via its Universal Windows Platform (UWP) APIs
   15.14 -* Windows 8.x
   15.15 -* Windows RT 8.x (aka. Windows 8.x for ARM processors)
   15.16 -* Windows Phone 8.x
   15.17 -
   15.18 -
   15.19 -Requirements
   15.20 -------------
   15.21 -
   15.22 -* Microsoft Visual C++ (aka Visual Studio), either 2015, 2013, or 2012
   15.23 -  - Free, "Community" or "Express" editions may be used, so long as they
   15.24 -    include  support for either "Windows Store" or "Windows Phone" apps.
   15.25 -    "Express" versions marked as supporting "Windows Desktop" development
   15.26 -    typically do not include support for creating WinRT apps, to note.
   15.27 -    (The "Community" editions of Visual C++ do, however, support both
   15.28 -    desktop/Win32 and WinRT development).
   15.29 -  - Visual C++ 2012 can only build apps that target versions 8.0 of Windows,
   15.30 -    or  Windows Phone.  8.0-targetted apps will run on devices running 8.1
   15.31 -    editions of Windows, however they will not be able to take advantage of
   15.32 -    8.1-specific features.
   15.33 -  - Visual C++ 2013 cannot create app projects that target Windows 8.0.
   15.34 -    Visual C++ 2013 Update 4, can create app projects for Windows Phone 8.0,
   15.35 -    Windows Phone 8.1, and Windows 8.1, but not Windows 8.0.  An optional
   15.36 -    Visual Studio add-in, "Tools for Maintaining Store apps for Windows 8",
   15.37 -    allows Visual C++ 2013 to load and build Windows 8.0 projects that were
   15.38 -    created with Visual C++ 2012, so long as Visual C++ 2012 is installed
   15.39 -    on the same machine.  More details on targeting different versions of
   15.40 -    Windows can found at the following web pages:
   15.41 -      - [Develop apps by using Visual Studio 2013](http://msdn.microsoft.com/en-us/library/windows/apps/br211384.aspx)
   15.42 -      - [To add the Tools for Maintaining Store apps for Windows 8](http://msdn.microsoft.com/en-us/library/windows/apps/dn263114.aspx#AddMaintenanceTools)
   15.43 -* A valid Microsoft account - This requirement is not imposed by SDL, but
   15.44 -  rather by Microsoft's Visual C++ toolchain.  This is required to launch or 
   15.45 -  debug apps.
   15.46 -
   15.47 -
   15.48 -Status
   15.49 -------
   15.50 -
   15.51 -Here is a rough list of what works, and what doens't:
   15.52 -
   15.53 -* What works:
   15.54 -  * compilation via Visual C++ 2012 through 2015
   15.55 -  * compile-time platform detection for SDL programs.  The C/C++ #define,
   15.56 -    `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT.
   15.57 -  * GPU-accelerated 2D rendering, via SDL_Renderer.
   15.58 -  * OpenGL ES 2, via the ANGLE library (included separately from SDL)
   15.59 -  * software rendering, via either SDL_Surface (optionally in conjunction with
   15.60 -    SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the
   15.61 -    SDL_Renderer APIs
   15.62 -  * threads
   15.63 -  * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(),
   15.64 -    SDL_GetPerformanceFrequency(), etc.)
   15.65 -  * file I/O via SDL_RWops
   15.66 -  * mouse input  (unsupported on Windows Phone)
   15.67 -  * audio, via a modified version of SDL's XAudio2 backend
   15.68 -  * .DLL file loading.  Libraries *MUST* be packaged inside applications.  Loading
   15.69 -    anything outside of the app is not supported.
   15.70 -  * system path retrieval via SDL's filesystem APIs
   15.71 -  * game controllers.  Support is provided via the SDL_Joystick and
   15.72 -    SDL_GameController APIs, and is backed by Microsoft's XInput API.
   15.73 -  * multi-touch input
   15.74 -  * app events.  SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as
   15.75 -    appropriate.
   15.76 -  * window events
   15.77 -  * using Direct3D 11.x APIs outside of SDL.  Non-XAML / Direct3D-only apps can
   15.78 -    choose to render content directly via Direct3D, using SDL to manage the
   15.79 -    internal WinRT window, as well as input and audio.  (Use
   15.80 -    SDL_GetWindowWMInfo() to get the WinRT 'CoreWindow', and pass it into
   15.81 -    IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.)
   15.82 -
   15.83 -* What partially works:
   15.84 -  * keyboard input.  Most of WinRT's documented virtual keys are supported, as
   15.85 -    well as many keys with documented hardware scancodes.  Converting
   15.86 -    SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs
   15.87 -    (MapVirualKey()) in Microsoft's Windows Store / UWP APIs.
   15.88 -  * SDLmain.  WinRT uses a different signature for each app's main() function.
   15.89 -    SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp
   15.90 -    (in `SDL\src\main\winrt\`) directly in order for their C-style main()
   15.91 -    functions to be called.
   15.92 -
   15.93 -* What doesn't work:
   15.94 -  * compilation with anything other than Visual C++
   15.95 -  * programmatically-created custom cursors.  These don't appear to be supported
   15.96 -    by WinRT.  Different OS-provided cursors can, however, be created via
   15.97 -    SDL_CreateSystemCursor() (unsupported on Windows Phone)
   15.98 -  * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal().  This are not currently
   15.99 -    supported by WinRT itself.
  15.100 -  * joysticks and game controllers that aren't supported by Microsoft's XInput
  15.101 -    API.
  15.102 -  * turning off VSync when rendering on Windows Phone.  Attempts to turn VSync
  15.103 -    off on Windows Phone result either in Direct3D not drawing anything, or it
  15.104 -    forcing VSync back on.  As such, SDL_RENDERER_PRESENTVSYNC will always get
  15.105 -    turned-on on Windows Phone.  This limitation is not present in non-Phone
  15.106 -    WinRT (such as Windows 8.x), where turning off VSync appears to work.
  15.107 -  * probably anything else that's not listed as supported
  15.108 -
  15.109 -
  15.110 -
  15.111 -Upgrade Notes
  15.112 --------------
  15.113 -
  15.114 -#### SDL_GetPrefPath() usage when upgrading WinRT apps from SDL 2.0.3
  15.115 -
  15.116 -SDL 2.0.4 fixes two bugs found in the WinRT version of SDL_GetPrefPath().
  15.117 -The fixes may affect older, SDL 2.0.3-based apps' save data.  Please note
  15.118 -that these changes only apply to SDL-based WinRT apps, and not to apps for
  15.119 -any other platform.
  15.120 -
  15.121 -1. SDL_GetPrefPath() would return an invalid path, one in which the path's
  15.122 -   directory had not been created.  Attempts to create files there
  15.123 -   (via fopen(), for example), would fail, unless that directory was
  15.124 -   explicitly created beforehand.
  15.125 -
  15.126 -2. SDL_GetPrefPath(), for non-WinPhone-based apps, would return a path inside
  15.127 -   a WinRT 'Roaming' folder, the contents of which get automatically
  15.128 -   synchronized across multiple devices.  This process can occur while an
  15.129 -   application runs, and can cause existing save-data to be overwritten
  15.130 -   at unexpected times, with data from other devices.  (Windows Phone apps
  15.131 -   written with SDL 2.0.3 did not utilize a Roaming folder, due to API
  15.132 -   restrictions in Windows Phone 8.0).
  15.133 -
  15.134 -
  15.135 -SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by:
  15.136 -
  15.137 -1. making sure that SDL_GetPrefPath() returns a directory in which data
  15.138 -   can be written to immediately, without first needing to create directories.
  15.139 -
  15.140 -2. basing SDL_GetPrefPath() off of a different, non-Roaming folder, the
  15.141 -   contents of which do not automatically get synchronized across devices
  15.142 -   (and which require less work to use safely, in terms of data integrity).
  15.143 -
  15.144 -Apps that wish to get their Roaming folder's path can do so either by using
  15.145 -SDL_WinRTGetFSPathUTF8(), SDL_WinRTGetFSPathUNICODE() (which returns a
  15.146 -UCS-2/wide-char string), or directly through the WinRT class,
  15.147 -Windows.Storage.ApplicationData.
  15.148 -
  15.149 -
  15.150 -
  15.151 -Setup, High-Level Steps
  15.152 ------------------------
  15.153 -
  15.154 -The steps for setting up a project for an SDL/WinRT app looks like the
  15.155 -following, at a high-level:
  15.156 -
  15.157 -1. create a new Visual C++ project using Microsoft's template for a,
  15.158 -   "Direct3D App".
  15.159 -2. remove most of the files from the project.
  15.160 -3. make your app's project directly reference SDL/WinRT's own Visual C++
  15.161 -   project file, via use of Visual C++'s "References" dialog.  This will setup
  15.162 -   the linker, and will copy SDL's .dll files to your app's final output.
  15.163 -4. adjust your app's build settings, at minimum, telling it where to find SDL's
  15.164 -   header files.
  15.165 -5. add files that contains a WinRT-appropriate main function, along with some
  15.166 -   data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls)
  15.167 -   work properly.
  15.168 -6. add SDL-specific app code.
  15.169 -7. build and run your app.
  15.170 -
  15.171 -
  15.172 -Setup, Detailed Steps
  15.173 ----------------------
  15.174 -
  15.175 -### 1. Create a new project ###
  15.176 -
  15.177 -Create a new project using one of Visual C++'s templates for a plain, non-XAML,
  15.178 -"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use).  If you
  15.179 -don't see one of these templates, in Visual C++'s 'New Project' dialog, try
  15.180 -using the textbox titled, 'Search Installed Templates' to look for one.
  15.181 -
  15.182 -
  15.183 -### 2. Remove unneeded files from the project ###
  15.184 -
  15.185 -In the new project, delete any file that has one of the following extensions:
  15.186 -
  15.187 -- .cpp
  15.188 -- .h
  15.189 -- .hlsl
  15.190 -
  15.191 -When you are done, you should be left with a few files, each of which will be a
  15.192 -necessary part of your app's project.  These files will consist of:
  15.193 -
  15.194 -- an .appxmanifest file, which contains metadata on your WinRT app.  This is
  15.195 -  similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android.
  15.196 -- a few .png files, one of which is a splash screen (displayed when your app
  15.197 -  launches), others are app icons.
  15.198 -- a .pfx file, used for code signing purposes.
  15.199 -
  15.200 -
  15.201 -### 3. Add references to SDL's project files ###
  15.202 -
  15.203 -SDL/WinRT can be built in multiple variations, spanning across three different
  15.204 -CPU architectures (x86, x64, and ARM) and two different configurations
  15.205 -(Debug and Release).  WinRT and Visual C++ do not currently provide a means
  15.206 -for combining multiple variations of one library into a single file.
  15.207 -Furthermore, it does not provide an easy means for copying pre-built .dll files
  15.208 -into your app's final output (via Post-Build steps, for example).  It does,
  15.209 -however, provide a system whereby an app can reference the MSVC projects of
  15.210 -libraries such that, when the app is built:
  15.211 -
  15.212 -1. each library gets built for the appropriate CPU architecture(s) and WinRT
  15.213 -   platform(s).
  15.214 -2. each library's output, such as .dll files, get copied to the app's build 
  15.215 -   output.
  15.216 -
  15.217 -To set this up for SDL/WinRT, you'll need to run through the following steps:
  15.218 -
  15.219 -1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then
  15.220 -   "Solution Explorer")
  15.221 -2. right click on your app's solution.
  15.222 -3. navigate to "Add", then to "Existing Project..."
  15.223 -4. find SDL/WinRT's Visual C++ project file and open it.  Different project
  15.224 -   files exist for different WinRT platforms.  All of them are in SDL's
  15.225 -   source distribution, in the following directories:
  15.226 -    * `VisualC-WinRT/UWP_VS2015/`        - for Windows 10 / UWP apps
  15.227 -    * `VisualC-WinRT/WinPhone81_VS2013/` - for Windows Phone 8.1 apps
  15.228 -    * `VisualC-WinRT/WinRT80_VS2012/`    - for Windows 8.0 apps
  15.229 -    * `VisualC-WinRT/WinRT81_VS2013/`    - for Windows 8.1 apps
  15.230 -5. once the project has been added, right-click on your app's project and
  15.231 -   select, "References..."
  15.232 -6. click on the button titled, "Add New Reference..."
  15.233 -7. check the box next to SDL
  15.234 -8. click OK to close the dialog
  15.235 -9. SDL will now show up in the list of references.  Click OK to close that
  15.236 -   dialog.
  15.237 -
  15.238 -Your project is now linked to SDL's project, insofar that when the app is
  15.239 -built, SDL will be built as well, with its build output getting included with
  15.240 -your app.
  15.241 -
  15.242 -
  15.243 -### 4. Adjust Your App's Build Settings ###
  15.244 -
  15.245 -Some build settings need to be changed in your app's project.  This guide will
  15.246 -outline the following:
  15.247 -
  15.248 -- making sure that the compiler knows where to find SDL's header files
  15.249 -- **Optional for C++, but NECESSARY for compiling C code:** telling the
  15.250 -  compiler not to use Microsoft's C++ extensions for WinRT development.
  15.251 -- **Optional:** telling the compiler not generate errors due to missing
  15.252 -  precompiled header files.
  15.253 -
  15.254 -To change these settings:
  15.255 -
  15.256 -1. right-click on the project
  15.257 -2. choose "Properties"
  15.258 -3. in the drop-down box next to "Configuration", choose, "All Configurations"
  15.259 -4. in the drop-down box next to "Platform", choose, "All Platforms"
  15.260 -5. in the left-hand list, expand the "C/C++" section
  15.261 -6. select "General"
  15.262 -7. edit the "Additional Include Directories" setting, and add a path to SDL's
  15.263 -   "include" directory
  15.264 -8. **Optional: to enable compilation of C code:** change the setting for
  15.265 -   "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No".  If you're 
  15.266 -   working with a completely C++ based project, this step can usually be 
  15.267 -   omitted.
  15.268 -9. **Optional: to disable precompiled headers (which can produce 
  15.269 -   'stdafx.h'-related build errors, if setup incorrectly:** in the left-hand 
  15.270 -   list, select "Precompiled Headers", then change the setting for "Precompiled 
  15.271 -   Header" from "Use (/Yu)" to "Not Using Precompiled Headers".
  15.272 -10. close the dialog, saving settings, by clicking the "OK" button
  15.273 -
  15.274 -
  15.275 -### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ###
  15.276 -
  15.277 -A few files should be included directly in your app's MSVC project, specifically:
  15.278 -1. a WinRT-appropriate main function (which is different than main() functions on
  15.279 -   other platforms)
  15.280 -2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor
  15.281 -   (if and when the app needs to do so).  *If this cursor resource is not
  15.282 -   included, mouse-position reporting may fail if and when the cursor is
  15.283 -   hidden, due to possible bugs/design-oddities in Windows itself.*
  15.284 -
  15.285 -To include these files:
  15.286 -
  15.287 -1. right-click on your project (again, in Visual C++'s Solution Explorer), 
  15.288 -   navigate to "Add", then choose "Existing Item...".
  15.289 -2. navigate to the directory containing SDL's source code, then into its
  15.290 -   subdirectory, 'src/main/winrt/'.  Select, then add, the following files:
  15.291 -   - `SDL_winrt_main_NonXAML.cpp`
  15.292 -   - `SDL2-WinRTResources.rc`
  15.293 -   - `SDL2-WinRTResource_BlankCursor.cur`
  15.294 -3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your
  15.295 -   project), then click on "Properties...".
  15.296 -4. in the drop-down box next to "Configuration", choose, "All Configurations"
  15.297 -5. in the drop-down box next to "Platform", choose, "All Platforms"
  15.298 -6. in the left-hand list, click on "C/C++"
  15.299 -7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)".
  15.300 -8. click the OK button.  This will close the dialog.
  15.301 -
  15.302 -
  15.303 -**NOTE: C++/CX compilation is currently required in at least one file of your 
  15.304 -app's project.  This is to make sure that Visual C++'s linker builds a 'Windows 
  15.305 -Metadata' file (.winmd) for your app.  Not doing so can lead to build errors.**
  15.306 -
  15.307 -
  15.308 -### 6. Add app code and assets ###
  15.309 -
  15.310 -At this point, you can add in SDL-specific source code.  Be sure to include a 
  15.311 -C-style main function (ie: `int main(int argc, char *argv[])`).  From there you 
  15.312 -should be able to create a single `SDL_Window` (WinRT apps can only have one 
  15.313 -window, at present), as well as an `SDL_Renderer`.  Direct3D will be used to 
  15.314 -draw content.  Events are received via SDL's usual event functions 
  15.315 -(`SDL_PollEvent`, etc.)  If you have a set of existing source files and assets, 
  15.316 -you can start adding them to the project now.  If not, or if you would like to 
  15.317 -make sure that you're setup correctly, some short and simple sample code is 
  15.318 -provided below.
  15.319 -
  15.320 -
  15.321 -#### 6.A. ... when creating a new app ####
  15.322 -
  15.323 -If you are creating a new app (rather than porting an existing SDL-based app), 
  15.324 -or if you would just like a simple app to test SDL/WinRT with before trying to 
  15.325 -get existing code working, some working SDL/WinRT code is provided below.  To 
  15.326 -set this up:
  15.327 -
  15.328 -1. right click on your app's project
  15.329 -2. select Add, then New Item.  An "Add New Item" dialog will show up.
  15.330 -3. from the left-hand list, choose "Visual C++"
  15.331 -4. from the middle/main list, choose "C++ File (.cpp)"
  15.332 -5. near the bottom of the dialog, next to "Name:", type in a name for your 
  15.333 -source file, such as, "main.cpp".
  15.334 -6. click on the Add button.  This will close the dialog, add the new file to 
  15.335 -your project, and open the file in Visual C++'s text editor.
  15.336 -7. Copy and paste the following code into the new file, then save it.
  15.337 -
  15.338 -
  15.339 -    #include <SDL.h>
  15.340 -    
  15.341 -    int main(int argc, char **argv)
  15.342 -    {
  15.343 -        SDL_DisplayMode mode;
  15.344 -        SDL_Window * window = NULL;
  15.345 -        SDL_Renderer * renderer = NULL;
  15.346 -        SDL_Event evt;
  15.347 -    
  15.348 -        if (SDL_Init(SDL_INIT_VIDEO) != 0) {
  15.349 -            return 1;
  15.350 -        }
  15.351 -    
  15.352 -        if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
  15.353 -            return 1;
  15.354 -        }
  15.355 -    
  15.356 -        if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
  15.357 -            return 1;
  15.358 -        }
  15.359 -    
  15.360 -        while (1) {
  15.361 -            while (SDL_PollEvent(&evt)) {
  15.362 -            }
  15.363 -    
  15.364 -            SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
  15.365 -            SDL_RenderClear(renderer);
  15.366 -            SDL_RenderPresent(renderer);
  15.367 -        }
  15.368 -    }
  15.369 -
  15.370 -
  15.371 -#### 6.B. Adding code and assets ####
  15.372 -
  15.373 -If you have existing code and assets that you'd like to add, you should be able 
  15.374 -to add them now.  The process for adding a set of files is as such.
  15.375 -
  15.376 -1. right click on the app's project
  15.377 -2. select Add, then click on "New Item..."
  15.378 -3. open any source, header, or asset files as appropriate.  Support for C and 
  15.379 -C++ is available.
  15.380 -
  15.381 -Do note that WinRT only supports a subset of the APIs that are available to 
  15.382 -Win32-based apps.  Many portions of the Win32 API and the C runtime are not 
  15.383 -available.
  15.384 -
  15.385 -A list of unsupported C APIs can be found at 
  15.386 -<http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx>
  15.387 -
  15.388 -General information on using the C runtime in WinRT can be found at 
  15.389 -<https://msdn.microsoft.com/en-us/library/hh972425.aspx>
  15.390 -
  15.391 -A list of supported Win32 APIs for WinRT apps can be found at 
  15.392 -<http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx>.  To note, 
  15.393 -the list of supported Win32 APIs for Windows Phone 8.0 is different.  
  15.394 -That list can be found at 
  15.395 -<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662956(v=vs.105).aspx>
  15.396 -
  15.397 -
  15.398 -### 7. Build and run your app ###
  15.399 -
  15.400 -Your app project should now be setup, and you should be ready to build your app.  
  15.401 -To run it on the local machine, open the Debug menu and choose "Start 
  15.402 -Debugging".  This will build your app, then run your app full-screen.  To switch 
  15.403 -out of your app, press the Windows key.  Alternatively, you can choose to run 
  15.404 -your app in a window.  To do this, before building and running your app, find 
  15.405 -the drop-down menu in Visual C++'s toolbar that says, "Local Machine".  Expand 
  15.406 -this by clicking on the arrow on the right side of the list, then click on 
  15.407 -Simulator.  Once you do that, any time you build and run the app, the app will 
  15.408 -launch in window, rather than full-screen.
  15.409 -
  15.410 -
  15.411 -#### 7.A. Running apps on older, ARM-based, "Windows RT" devices ####
  15.412 -
  15.413 -**These instructions do not include Windows Phone, despite Windows Phone
  15.414 -typically running on ARM processors.**  They are specifically for devices
  15.415 -that use the "Windows RT" operating system, which was a modified version of
  15.416 -Windows 8.x that ran primarily on ARM-based tablet computers.
  15.417 -
  15.418 -To build and run the app on ARM-based, "Windows RT" devices, you'll need to:
  15.419 -
  15.420 -- install Microsoft's "Remote Debugger" on the device.  Visual C++ installs and 
  15.421 -  debugs ARM-based apps via IP networks.
  15.422 -- change a few options on the development machine, both to make sure it builds 
  15.423 -  for ARM (rather than x86 or x64), and to make sure it knows how to find the 
  15.424 -  Windows RT device (on the network).
  15.425 -
  15.426 -Microsoft's Remote Debugger can be found at 
  15.427 -<https://msdn.microsoft.com/en-us/library/hh441469.aspx>.  Please note 
  15.428 -that separate versions of this debugger exist for different versions of Visual 
  15.429 -C++, one each for MSVC 2015, 2013, and 2012.
  15.430 -
  15.431 -To setup Visual C++ to launch your app on an ARM device:
  15.432 -
  15.433 -1. make sure the Remote Debugger is running on your ARM device, and that it's on 
  15.434 -   the same IP network as your development machine.
  15.435 -2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32".  Click 
  15.436 -   it, then change the value to "ARM".
  15.437 -3. make sure Visual C++ knows the hostname or IP address of the ARM device.  To 
  15.438 -   do this:
  15.439 -    1. open the app project's properties
  15.440 -    2. select "Debugging"
  15.441 -    3. next to "Machine Name", enter the hostname or IP address of the ARM 
  15.442 -       device
  15.443 -    4. if, and only if, you've turned off authentication in the Remote Debugger,
  15.444 -       then change the setting for "Require Authentication" to No
  15.445 -    5. click "OK"
  15.446 -4. build and run the app (from Visual C++).  The first time you do this, a 
  15.447 -   prompt will show up on the ARM device, asking for a Microsoft Account.  You 
  15.448 -   do, unfortunately, need to log in here, and will need to follow the 
  15.449 -   subsequent registration steps in order to launch the app.  After you do so, 
  15.450 -   if the app didn't already launch, try relaunching it again from within Visual 
  15.451 -   C++.
  15.452 -
  15.453 -
  15.454 -Troubleshooting
  15.455 ----------------
  15.456 -
  15.457 -#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'"
  15.458 -
  15.459 -Try adding the following to your linker flags.  In MSVC, this can be done by
  15.460 -right-clicking on the app project, navigating to Configuration Properties ->
  15.461 -Linker -> Command Line, then adding them to the Additional Options
  15.462 -section.
  15.463 -
  15.464 -* For Release builds / MSVC-Configurations, add:
  15.465 -
  15.466 -    /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib
  15.467 -
  15.468 -* For Debug builds / MSVC-Configurations, add:
  15.469 -
  15.470 -    /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib
  15.471 -
  15.472 -
  15.473 -#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values
  15.474 -
  15.475 -This may be caused by a bug in Windows itself, whereby hiding the mouse
  15.476 -cursor can cause mouse-position reporting to fail.
  15.477 -
  15.478 -SDL provides a workaround for this, but it requires that an app links to a
  15.479 -set of Win32-style cursor image-resource files.  A copy of suitable resource
  15.480 -files can be found in `src/main/winrt/`.  Adding them to an app's Visual C++
  15.481 -project file should be sufficient to get the app to use them.
  15.482 +WinRT
  15.483 +=====
  15.484 +
  15.485 +This port allows SDL applications to run on Microsoft's platforms that require
  15.486 +use of "Windows Runtime", aka. "WinRT", APIs.  Microsoft may, in some cases,
  15.487 +refer to them as either "Windows Store", or for Windows 10, "UWP" apps.
  15.488 +
  15.489 +Some of the operating systems that include WinRT, are:
  15.490 +
  15.491 +* Windows 10, via its Universal Windows Platform (UWP) APIs
  15.492 +* Windows 8.x
  15.493 +* Windows RT 8.x (aka. Windows 8.x for ARM processors)
  15.494 +* Windows Phone 8.x
  15.495 +
  15.496 +
  15.497 +Requirements
  15.498 +------------
  15.499 +
  15.500 +* Microsoft Visual C++ (aka Visual Studio), either 2015, 2013, or 2012
  15.501 +  - Free, "Community" or "Express" editions may be used, so long as they
  15.502 +    include  support for either "Windows Store" or "Windows Phone" apps.
  15.503 +    "Express" versions marked as supporting "Windows Desktop" development
  15.504 +    typically do not include support for creating WinRT apps, to note.
  15.505 +    (The "Community" editions of Visual C++ do, however, support both
  15.506 +    desktop/Win32 and WinRT development).
  15.507 +  - Visual C++ 2012 can only build apps that target versions 8.0 of Windows,
  15.508 +    or  Windows Phone.  8.0-targetted apps will run on devices running 8.1
  15.509 +    editions of Windows, however they will not be able to take advantage of
  15.510 +    8.1-specific features.
  15.511 +  - Visual C++ 2013 cannot create app projects that target Windows 8.0.
  15.512 +    Visual C++ 2013 Update 4, can create app projects for Windows Phone 8.0,
  15.513 +    Windows Phone 8.1, and Windows 8.1, but not Windows 8.0.  An optional
  15.514 +    Visual Studio add-in, "Tools for Maintaining Store apps for Windows 8",
  15.515 +    allows Visual C++ 2013 to load and build Windows 8.0 projects that were
  15.516 +    created with Visual C++ 2012, so long as Visual C++ 2012 is installed
  15.517 +    on the same machine.  More details on targeting different versions of
  15.518 +    Windows can found at the following web pages:
  15.519 +      - [Develop apps by using Visual Studio 2013](http://msdn.microsoft.com/en-us/library/windows/apps/br211384.aspx)
  15.520 +      - [To add the Tools for Maintaining Store apps for Windows 8](http://msdn.microsoft.com/en-us/library/windows/apps/dn263114.aspx#AddMaintenanceTools)
  15.521 +* A valid Microsoft account - This requirement is not imposed by SDL, but
  15.522 +  rather by Microsoft's Visual C++ toolchain.  This is required to launch or 
  15.523 +  debug apps.
  15.524 +
  15.525 +
  15.526 +Status
  15.527 +------
  15.528 +
  15.529 +Here is a rough list of what works, and what doens't:
  15.530 +
  15.531 +* What works:
  15.532 +  * compilation via Visual C++ 2012 through 2015
  15.533 +  * compile-time platform detection for SDL programs.  The C/C++ #define,
  15.534 +    `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT.
  15.535 +  * GPU-accelerated 2D rendering, via SDL_Renderer.
  15.536 +  * OpenGL ES 2, via the ANGLE library (included separately from SDL)
  15.537 +  * software rendering, via either SDL_Surface (optionally in conjunction with
  15.538 +    SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the
  15.539 +    SDL_Renderer APIs
  15.540 +  * threads
  15.541 +  * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(),
  15.542 +    SDL_GetPerformanceFrequency(), etc.)
  15.543 +  * file I/O via SDL_RWops
  15.544 +  * mouse input  (unsupported on Windows Phone)
  15.545 +  * audio, via a modified version of SDL's XAudio2 backend
  15.546 +  * .DLL file loading.  Libraries *MUST* be packaged inside applications.  Loading
  15.547 +    anything outside of the app is not supported.
  15.548 +  * system path retrieval via SDL's filesystem APIs
  15.549 +  * game controllers.  Support is provided via the SDL_Joystick and
  15.550 +    SDL_GameController APIs, and is backed by Microsoft's XInput API.
  15.551 +  * multi-touch input
  15.552 +  * app events.  SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as
  15.553 +    appropriate.
  15.554 +  * window events
  15.555 +  * using Direct3D 11.x APIs outside of SDL.  Non-XAML / Direct3D-only apps can
  15.556 +    choose to render content directly via Direct3D, using SDL to manage the
  15.557 +    internal WinRT window, as well as input and audio.  (Use
  15.558 +    SDL_GetWindowWMInfo() to get the WinRT 'CoreWindow', and pass it into
  15.559 +    IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.)
  15.560 +
  15.561 +* What partially works:
  15.562 +  * keyboard input.  Most of WinRT's documented virtual keys are supported, as
  15.563 +    well as many keys with documented hardware scancodes.  Converting
  15.564 +    SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs
  15.565 +    (MapVirualKey()) in Microsoft's Windows Store / UWP APIs.
  15.566 +  * SDLmain.  WinRT uses a different signature for each app's main() function.
  15.567 +    SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp
  15.568 +    (in `SDL\src\main\winrt\`) directly in order for their C-style main()
  15.569 +    functions to be called.
  15.570 +
  15.571 +* What doesn't work:
  15.572 +  * compilation with anything other than Visual C++
  15.573 +  * programmatically-created custom cursors.  These don't appear to be supported
  15.574 +    by WinRT.  Different OS-provided cursors can, however, be created via
  15.575 +    SDL_CreateSystemCursor() (unsupported on Windows Phone)
  15.576 +  * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal().  This are not currently
  15.577 +    supported by WinRT itself.
  15.578 +  * joysticks and game controllers that aren't supported by Microsoft's XInput
  15.579 +    API.
  15.580 +  * turning off VSync when rendering on Windows Phone.  Attempts to turn VSync
  15.581 +    off on Windows Phone result either in Direct3D not drawing anything, or it
  15.582 +    forcing VSync back on.  As such, SDL_RENDERER_PRESENTVSYNC will always get
  15.583 +    turned-on on Windows Phone.  This limitation is not present in non-Phone
  15.584 +    WinRT (such as Windows 8.x), where turning off VSync appears to work.
  15.585 +  * probably anything else that's not listed as supported
  15.586 +
  15.587 +
  15.588 +
  15.589 +Upgrade Notes
  15.590 +-------------
  15.591 +
  15.592 +#### SDL_GetPrefPath() usage when upgrading WinRT apps from SDL 2.0.3
  15.593 +
  15.594 +SDL 2.0.4 fixes two bugs found in the WinRT version of SDL_GetPrefPath().
  15.595 +The fixes may affect older, SDL 2.0.3-based apps' save data.  Please note
  15.596 +that these changes only apply to SDL-based WinRT apps, and not to apps for
  15.597 +any other platform.
  15.598 +
  15.599 +1. SDL_GetPrefPath() would return an invalid path, one in which the path's
  15.600 +   directory had not been created.  Attempts to create files there
  15.601 +   (via fopen(), for example), would fail, unless that directory was
  15.602 +   explicitly created beforehand.
  15.603 +
  15.604 +2. SDL_GetPrefPath(), for non-WinPhone-based apps, would return a path inside
  15.605 +   a WinRT 'Roaming' folder, the contents of which get automatically
  15.606 +   synchronized across multiple devices.  This process can occur while an
  15.607 +   application runs, and can cause existing save-data to be overwritten
  15.608 +   at unexpected times, with data from other devices.  (Windows Phone apps
  15.609 +   written with SDL 2.0.3 did not utilize a Roaming folder, due to API
  15.610 +   restrictions in Windows Phone 8.0).
  15.611 +
  15.612 +
  15.613 +SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by:
  15.614 +
  15.615 +1. making sure that SDL_GetPrefPath() returns a directory in which data
  15.616 +   can be written to immediately, without first needing to create directories.
  15.617 +
  15.618 +2. basing SDL_GetPrefPath() off of a different, non-Roaming folder, the
  15.619 +   contents of which do not automatically get synchronized across devices
  15.620 +   (and which require less work to use safely, in terms of data integrity).
  15.621 +
  15.622 +Apps that wish to get their Roaming folder's path can do so either by using
  15.623 +SDL_WinRTGetFSPathUTF8(), SDL_WinRTGetFSPathUNICODE() (which returns a
  15.624 +UCS-2/wide-char string), or directly through the WinRT class,
  15.625 +Windows.Storage.ApplicationData.
  15.626 +
  15.627 +
  15.628 +
  15.629 +Setup, High-Level Steps
  15.630 +-----------------------
  15.631 +
  15.632 +The steps for setting up a project for an SDL/WinRT app looks like the
  15.633 +following, at a high-level:
  15.634 +
  15.635 +1. create a new Visual C++ project using Microsoft's template for a,
  15.636 +   "Direct3D App".
  15.637 +2. remove most of the files from the project.
  15.638 +3. make your app's project directly reference SDL/WinRT's own Visual C++
  15.639 +   project file, via use of Visual C++'s "References" dialog.  This will setup
  15.640 +   the linker, and will copy SDL's .dll files to your app's final output.
  15.641 +4. adjust your app's build settings, at minimum, telling it where to find SDL's
  15.642 +   header files.
  15.643 +5. add files that contains a WinRT-appropriate main function, along with some
  15.644 +   data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls)
  15.645 +   work properly.
  15.646 +6. add SDL-specific app code.
  15.647 +7. build and run your app.
  15.648 +
  15.649 +
  15.650 +Setup, Detailed Steps
  15.651 +---------------------
  15.652 +
  15.653 +### 1. Create a new project ###
  15.654 +
  15.655 +Create a new project using one of Visual C++'s templates for a plain, non-XAML,
  15.656 +"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use).  If you
  15.657 +don't see one of these templates, in Visual C++'s 'New Project' dialog, try
  15.658 +using the textbox titled, 'Search Installed Templates' to look for one.
  15.659 +
  15.660 +
  15.661 +### 2. Remove unneeded files from the project ###
  15.662 +
  15.663 +In the new project, delete any file that has one of the following extensions:
  15.664 +
  15.665 +- .cpp
  15.666 +- .h
  15.667 +- .hlsl
  15.668 +
  15.669 +When you are done, you should be left with a few files, each of which will be a
  15.670 +necessary part of your app's project.  These files will consist of:
  15.671 +
  15.672 +- an .appxmanifest file, which contains metadata on your WinRT app.  This is
  15.673 +  similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android.
  15.674 +- a few .png files, one of which is a splash screen (displayed when your app
  15.675 +  launches), others are app icons.
  15.676 +- a .pfx file, used for code signing purposes.
  15.677 +
  15.678 +
  15.679 +### 3. Add references to SDL's project files ###
  15.680 +
  15.681 +SDL/WinRT can be built in multiple variations, spanning across three different
  15.682 +CPU architectures (x86, x64, and ARM) and two different configurations
  15.683 +(Debug and Release).  WinRT and Visual C++ do not currently provide a means
  15.684 +for combining multiple variations of one library into a single file.
  15.685 +Furthermore, it does not provide an easy means for copying pre-built .dll files
  15.686 +into your app's final output (via Post-Build steps, for example).  It does,
  15.687 +however, provide a system whereby an app can reference the MSVC projects of
  15.688 +libraries such that, when the app is built:
  15.689 +
  15.690 +1. each library gets built for the appropriate CPU architecture(s) and WinRT
  15.691 +   platform(s).
  15.692 +2. each library's output, such as .dll files, get copied to the app's build 
  15.693 +   output.
  15.694 +
  15.695 +To set this up for SDL/WinRT, you'll need to run through the following steps:
  15.696 +
  15.697 +1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then
  15.698 +   "Solution Explorer")
  15.699 +2. right click on your app's solution.
  15.700 +3. navigate to "Add", then to "Existing Project..."
  15.701 +4. find SDL/WinRT's Visual C++ project file and open it.  Different project
  15.702 +   files exist for different WinRT platforms.  All of them are in SDL's
  15.703 +   source distribution, in the following directories:
  15.704 +    * `VisualC-WinRT/UWP_VS2015/`        - for Windows 10 / UWP apps
  15.705 +    * `VisualC-WinRT/WinPhone81_VS2013/` - for Windows Phone 8.1 apps
  15.706 +    * `VisualC-WinRT/WinRT80_VS2012/`    - for Windows 8.0 apps
  15.707 +    * `VisualC-WinRT/WinRT81_VS2013/`    - for Windows 8.1 apps
  15.708 +5. once the project has been added, right-click on your app's project and
  15.709 +   select, "References..."
  15.710 +6. click on the button titled, "Add New Reference..."
  15.711 +7. check the box next to SDL
  15.712 +8. click OK to close the dialog
  15.713 +9. SDL will now show up in the list of references.  Click OK to close that
  15.714 +   dialog.
  15.715 +
  15.716 +Your project is now linked to SDL's project, insofar that when the app is
  15.717 +built, SDL will be built as well, with its build output getting included with
  15.718 +your app.
  15.719 +
  15.720 +
  15.721 +### 4. Adjust Your App's Build Settings ###
  15.722 +
  15.723 +Some build settings need to be changed in your app's project.  This guide will
  15.724 +outline the following:
  15.725 +
  15.726 +- making sure that the compiler knows where to find SDL's header files
  15.727 +- **Optional for C++, but NECESSARY for compiling C code:** telling the
  15.728 +  compiler not to use Microsoft's C++ extensions for WinRT development.
  15.729 +- **Optional:** telling the compiler not generate errors due to missing
  15.730 +  precompiled header files.
  15.731 +
  15.732 +To change these settings:
  15.733 +
  15.734 +1. right-click on the project
  15.735 +2. choose "Properties"
  15.736 +3. in the drop-down box next to "Configuration", choose, "All Configurations"
  15.737 +4. in the drop-down box next to "Platform", choose, "All Platforms"
  15.738 +5. in the left-hand list, expand the "C/C++" section
  15.739 +6. select "General"
  15.740 +7. edit the "Additional Include Directories" setting, and add a path to SDL's
  15.741 +   "include" directory
  15.742 +8. **Optional: to enable compilation of C code:** change the setting for
  15.743 +   "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No".  If you're 
  15.744 +   working with a completely C++ based project, this step can usually be 
  15.745 +   omitted.
  15.746 +9. **Optional: to disable precompiled headers (which can produce 
  15.747 +   'stdafx.h'-related build errors, if setup incorrectly:** in the left-hand 
  15.748 +   list, select "Precompiled Headers", then change the setting for "Precompiled 
  15.749 +   Header" from "Use (/Yu)" to "Not Using Precompiled Headers".
  15.750 +10. close the dialog, saving settings, by clicking the "OK" button
  15.751 +
  15.752 +
  15.753 +### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ###
  15.754 +
  15.755 +A few files should be included directly in your app's MSVC project, specifically:
  15.756 +1. a WinRT-appropriate main function (which is different than main() functions on
  15.757 +   other platforms)
  15.758 +2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor
  15.759 +   (if and when the app needs to do so).  *If this cursor resource is not
  15.760 +   included, mouse-position reporting may fail if and when the cursor is
  15.761 +   hidden, due to possible bugs/design-oddities in Windows itself.*
  15.762 +
  15.763 +To include these files:
  15.764 +
  15.765 +1. right-click on your project (again, in Visual C++'s Solution Explorer), 
  15.766 +   navigate to "Add", then choose "Existing Item...".
  15.767 +2. navigate to the directory containing SDL's source code, then into its
  15.768 +   subdirectory, 'src/main/winrt/'.  Select, then add, the following files:
  15.769 +   - `SDL_winrt_main_NonXAML.cpp`
  15.770 +   - `SDL2-WinRTResources.rc`
  15.771 +   - `SDL2-WinRTResource_BlankCursor.cur`
  15.772 +3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your
  15.773 +   project), then click on "Properties...".
  15.774 +4. in the drop-down box next to "Configuration", choose, "All Configurations"
  15.775 +5. in the drop-down box next to "Platform", choose, "All Platforms"
  15.776 +6. in the left-hand list, click on "C/C++"
  15.777 +7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)".
  15.778 +8. click the OK button.  This will close the dialog.
  15.779 +
  15.780 +
  15.781 +**NOTE: C++/CX compilation is currently required in at least one file of your 
  15.782 +app's project.  This is to make sure that Visual C++'s linker builds a 'Windows 
  15.783 +Metadata' file (.winmd) for your app.  Not doing so can lead to build errors.**
  15.784 +
  15.785 +
  15.786 +### 6. Add app code and assets ###
  15.787 +
  15.788 +At this point, you can add in SDL-specific source code.  Be sure to include a 
  15.789 +C-style main function (ie: `int main(int argc, char *argv[])`).  From there you 
  15.790 +should be able to create a single `SDL_Window` (WinRT apps can only have one 
  15.791 +window, at present), as well as an `SDL_Renderer`.  Direct3D will be used to 
  15.792 +draw content.  Events are received via SDL's usual event functions 
  15.793 +(`SDL_PollEvent`, etc.)  If you have a set of existing source files and assets, 
  15.794 +you can start adding them to the project now.  If not, or if you would like to 
  15.795 +make sure that you're setup correctly, some short and simple sample code is 
  15.796 +provided below.
  15.797 +
  15.798 +
  15.799 +#### 6.A. ... when creating a new app ####
  15.800 +
  15.801 +If you are creating a new app (rather than porting an existing SDL-based app), 
  15.802 +or if you would just like a simple app to test SDL/WinRT with before trying to 
  15.803 +get existing code working, some working SDL/WinRT code is provided below.  To 
  15.804 +set this up:
  15.805 +
  15.806 +1. right click on your app's project
  15.807 +2. select Add, then New Item.  An "Add New Item" dialog will show up.
  15.808 +3. from the left-hand list, choose "Visual C++"
  15.809 +4. from the middle/main list, choose "C++ File (.cpp)"
  15.810 +5. near the bottom of the dialog, next to "Name:", type in a name for your 
  15.811 +source file, such as, "main.cpp".
  15.812 +6. click on the Add button.  This will close the dialog, add the new file to 
  15.813 +your project, and open the file in Visual C++'s text editor.
  15.814 +7. Copy and paste the following code into the new file, then save it.
  15.815 +
  15.816 +
  15.817 +    #include <SDL.h>
  15.818 +    
  15.819 +    int main(int argc, char **argv)
  15.820 +    {
  15.821 +        SDL_DisplayMode mode;
  15.822 +        SDL_Window * window = NULL;
  15.823 +        SDL_Renderer * renderer = NULL;
  15.824 +        SDL_Event evt;
  15.825 +    
  15.826 +        if (SDL_Init(SDL_INIT_VIDEO) != 0) {
  15.827 +            return 1;
  15.828 +        }
  15.829 +    
  15.830 +        if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
  15.831 +            return 1;
  15.832 +        }
  15.833 +    
  15.834 +        if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
  15.835 +            return 1;
  15.836 +        }
  15.837 +    
  15.838 +        while (1) {
  15.839 +            while (SDL_PollEvent(&evt)) {
  15.840 +            }
  15.841 +    
  15.842 +            SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
  15.843 +            SDL_RenderClear(renderer);
  15.844 +            SDL_RenderPresent(renderer);
  15.845 +        }
  15.846 +    }
  15.847 +
  15.848 +
  15.849 +#### 6.B. Adding code and assets ####
  15.850 +
  15.851 +If you have existing code and assets that you'd like to add, you should be able 
  15.852 +to add them now.  The process for adding a set of files is as such.
  15.853 +
  15.854 +1. right click on the app's project
  15.855 +2. select Add, then click on "New Item..."
  15.856 +3. open any source, header, or asset files as appropriate.  Support for C and 
  15.857 +C++ is available.
  15.858 +
  15.859 +Do note that WinRT only supports a subset of the APIs that are available to 
  15.860 +Win32-based apps.  Many portions of the Win32 API and the C runtime are not 
  15.861 +available.
  15.862 +
  15.863 +A list of unsupported C APIs can be found at 
  15.864 +<http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx>
  15.865 +
  15.866 +General information on using the C runtime in WinRT can be found at 
  15.867 +<https://msdn.microsoft.com/en-us/library/hh972425.aspx>
  15.868 +
  15.869 +A list of supported Win32 APIs for WinRT apps can be found at 
  15.870 +<http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx>.  To note, 
  15.871 +the list of supported Win32 APIs for Windows Phone 8.0 is different.  
  15.872 +That list can be found at 
  15.873 +<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662956(v=vs.105).aspx>
  15.874 +
  15.875 +
  15.876 +### 7. Build and run your app ###
  15.877 +
  15.878 +Your app project should now be setup, and you should be ready to build your app.  
  15.879 +To run it on the local machine, open the Debug menu and choose "Start 
  15.880 +Debugging".  This will build your app, then run your app full-screen.  To switch 
  15.881 +out of your app, press the Windows key.  Alternatively, you can choose to run 
  15.882 +your app in a window.  To do this, before building and running your app, find 
  15.883 +the drop-down menu in Visual C++'s toolbar that says, "Local Machine".  Expand 
  15.884 +this by clicking on the arrow on the right side of the list, then click on 
  15.885 +Simulator.  Once you do that, any time you build and run the app, the app will 
  15.886 +launch in window, rather than full-screen.
  15.887 +
  15.888 +
  15.889 +#### 7.A. Running apps on older, ARM-based, "Windows RT" devices ####
  15.890 +
  15.891 +**These instructions do not include Windows Phone, despite Windows Phone
  15.892 +typically running on ARM processors.**  They are specifically for devices
  15.893 +that use the "Windows RT" operating system, which was a modified version of
  15.894 +Windows 8.x that ran primarily on ARM-based tablet computers.
  15.895 +
  15.896 +To build and run the app on ARM-based, "Windows RT" devices, you'll need to:
  15.897 +
  15.898 +- install Microsoft's "Remote Debugger" on the device.  Visual C++ installs and 
  15.899 +  debugs ARM-based apps via IP networks.
  15.900 +- change a few options on the development machine, both to make sure it builds 
  15.901 +  for ARM (rather than x86 or x64), and to make sure it knows how to find the 
  15.902 +  Windows RT device (on the network).
  15.903 +
  15.904 +Microsoft's Remote Debugger can be found at 
  15.905 +<https://msdn.microsoft.com/en-us/library/hh441469.aspx>.  Please note 
  15.906 +that separate versions of this debugger exist for different versions of Visual 
  15.907 +C++, one each for MSVC 2015, 2013, and 2012.
  15.908 +
  15.909 +To setup Visual C++ to launch your app on an ARM device:
  15.910 +
  15.911 +1. make sure the Remote Debugger is running on your ARM device, and that it's on 
  15.912 +   the same IP network as your development machine.
  15.913 +2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32".  Click 
  15.914 +   it, then change the value to "ARM".
  15.915 +3. make sure Visual C++ knows the hostname or IP address of the ARM device.  To 
  15.916 +   do this:
  15.917 +    1. open the app project's properties
  15.918 +    2. select "Debugging"
  15.919 +    3. next to "Machine Name", enter the hostname or IP address of the ARM 
  15.920 +       device
  15.921 +    4. if, and only if, you've turned off authentication in the Remote Debugger,
  15.922 +       then change the setting for "Require Authentication" to No
  15.923 +    5. click "OK"
  15.924 +4. build and run the app (from Visual C++).  The first time you do this, a 
  15.925 +   prompt will show up on the ARM device, asking for a Microsoft Account.  You 
  15.926 +   do, unfortunately, need to log in here, and will need to follow the 
  15.927 +   subsequent registration steps in order to launch the app.  After you do so, 
  15.928 +   if the app didn't already launch, try relaunching it again from within Visual 
  15.929 +   C++.
  15.930 +
  15.931 +
  15.932 +Troubleshooting
  15.933 +---------------
  15.934 +
  15.935 +#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'"
  15.936 +
  15.937 +Try adding the following to your linker flags.  In MSVC, this can be done by
  15.938 +right-clicking on the app project, navigating to Configuration Properties ->
  15.939 +Linker -> Command Line, then adding them to the Additional Options
  15.940 +section.
  15.941 +
  15.942 +* For Release builds / MSVC-Configurations, add:
  15.943 +
  15.944 +    /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib
  15.945 +
  15.946 +* For Debug builds / MSVC-Configurations, add:
  15.947 +
  15.948 +    /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib
  15.949 +
  15.950 +
  15.951 +#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values
  15.952 +
  15.953 +This may be caused by a bug in Windows itself, whereby hiding the mouse
  15.954 +cursor can cause mouse-position reporting to fail.
  15.955 +
  15.956 +SDL provides a workaround for this, but it requires that an app links to a
  15.957 +set of Win32-style cursor image-resource files.  A copy of suitable resource
  15.958 +files can be found in `src/main/winrt/`.  Adding them to an app's Visual C++
  15.959 +project file should be sufficient to get the app to use them.
    16.1 --- a/docs/README.md	Fri Oct 07 17:30:21 2016 -0700
    16.2 +++ b/docs/README.md	Fri Oct 07 17:46:58 2016 -0700
    16.3 @@ -1,63 +1,63 @@
    16.4 -Simple DirectMedia Layer {#mainpage}
    16.5 -========================
    16.6 -
    16.7 -                                  (SDL)
    16.8 -
    16.9 -                                Version 2.0
   16.10 -
   16.11 ----
   16.12 -http://www.libsdl.org/
   16.13 -
   16.14 -Simple DirectMedia Layer is a cross-platform development library designed
   16.15 -to provide low level access to audio, keyboard, mouse, joystick, and graphics
   16.16 -hardware via OpenGL and Direct3D. It is used by video playback software,
   16.17 -emulators, and popular games including Valve's award winning catalog
   16.18 -and many Humble Bundle games.
   16.19 -
   16.20 -SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
   16.21 -Support for other platforms may be found in the source code.
   16.22 -
   16.23 -SDL is written in C, works natively with C++, and there are bindings 
   16.24 -available for several other languages, including C# and Python.
   16.25 -
   16.26 -This library is distributed under the zlib license, which can be found
   16.27 -in the file "COPYING.txt".
   16.28 -
   16.29 -The best way to learn how to use SDL is to check out the header files in
   16.30 -the "include" subdirectory and the programs in the "test" subdirectory.
   16.31 -The header files and test programs are well commented and always up to date.
   16.32 -
   16.33 -More documentation and FAQs are available online at [the wiki](http://wiki.libsdl.org/)
   16.34 -
   16.35 -- [Android](README-android.md)
   16.36 -- [CMake](README-cmake.md)
   16.37 -- [DirectFB](README-directfb.md)
   16.38 -- [DynAPI](README-dynapi.md)
   16.39 -- [Emscripten](README-emscripten.md)
   16.40 -- [Gesture](README-gesture.md)
   16.41 -- [Mercurial](README-hg.md)
   16.42 -- [iOS](README-ios.md)
   16.43 -- [Linux](README-linux.md)
   16.44 -- [OS X](README-macosx.md)
   16.45 -- [Native Client](README-nacl.md)
   16.46 -- [Pandora](README-pandora.md)
   16.47 -- [Supported Platforms](README-platforms.md)
   16.48 -- [Porting information](README-porting.md)
   16.49 -- [PSP](README-psp.md)
   16.50 -- [Raspberry Pi](README-raspberrypi.md)
   16.51 -- [Touch](README-touch.md)
   16.52 -- [WinCE](README-wince.md)
   16.53 -- [Windows](README-windows.md)
   16.54 -- [WinRT](README-winrt.md)
   16.55 -
   16.56 -If you need help with the library, or just want to discuss SDL related
   16.57 -issues, you can join the [developers mailing list](http://www.libsdl.org/mailing-list.php)
   16.58 -
   16.59 -If you want to report bugs or contribute patches, please submit them to
   16.60 -[bugzilla](http://bugzilla.libsdl.org/)
   16.61 -
   16.62 -Enjoy!
   16.63 -
   16.64 -
   16.65 -Sam Lantinga <mailto:slouken@libsdl.org>
   16.66 -
   16.67 +Simple DirectMedia Layer {#mainpage}
   16.68 +========================
   16.69 +
   16.70 +                                  (SDL)
   16.71 +
   16.72 +                                Version 2.0
   16.73 +
   16.74 +---
   16.75 +http://www.libsdl.org/
   16.76 +
   16.77 +Simple DirectMedia Layer is a cross-platform development library designed
   16.78 +to provide low level access to audio, keyboard, mouse, joystick, and graphics
   16.79 +hardware via OpenGL and Direct3D. It is used by video playback software,
   16.80 +emulators, and popular games including Valve's award winning catalog
   16.81 +and many Humble Bundle games.
   16.82 +
   16.83 +SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
   16.84 +Support for other platforms may be found in the source code.
   16.85 +
   16.86 +SDL is written in C, works natively with C++, and there are bindings 
   16.87 +available for several other languages, including C# and Python.
   16.88 +
   16.89 +This library is distributed under the zlib license, which can be found
   16.90 +in the file "COPYING.txt".
   16.91 +
   16.92 +The best way to learn how to use SDL is to check out the header files in
   16.93 +the "include" subdirectory and the programs in the "test" subdirectory.
   16.94 +The header files and test programs are well commented and always up to date.
   16.95 +
   16.96 +More documentation and FAQs are available online at [the wiki](http://wiki.libsdl.org/)
   16.97 +
   16.98 +- [Android](README-android.md)
   16.99 +- [CMake](README-cmake.md)
  16.100 +- [DirectFB](README-directfb.md)
  16.101 +- [DynAPI](README-dynapi.md)
  16.102 +- [Emscripten](README-emscripten.md)
  16.103 +- [Gesture](README-gesture.md)
  16.104 +- [Mercurial](README-hg.md)
  16.105 +- [iOS](README-ios.md)
  16.106 +- [Linux](README-linux.md)
  16.107 +- [OS X](README-macosx.md)
  16.108 +- [Native Client](README-nacl.md)
  16.109 +- [Pandora](README-pandora.md)
  16.110 +- [Supported Platforms](README-platforms.md)
  16.111 +- [Porting information](README-porting.md)
  16.112 +- [PSP](README-psp.md)
  16.113 +- [Raspberry Pi](README-raspberrypi.md)
  16.114 +- [Touch](README-touch.md)
  16.115 +- [WinCE](README-wince.md)
  16.116 +- [Windows](README-windows.md)
  16.117 +- [WinRT](README-winrt.md)
  16.118 +
  16.119 +If you need help with the library, or just want to discuss SDL related
  16.120 +issues, you can join the [developers mailing list](http://www.libsdl.org/mailing-list.php)
  16.121 +
  16.122 +If you want to report bugs or contribute patches, please submit them to
  16.123 +[bugzilla](http://bugzilla.libsdl.org/)
  16.124 +
  16.125 +Enjoy!
  16.126 +
  16.127 +
  16.128 +Sam Lantinga <mailto:slouken@libsdl.org>
  16.129 +