docs/README-winrt.md
author David Ludwig <dludwig@pobox.com>
Sun, 14 Sep 2014 11:36:24 -0400
changeset 9139 b2231eba36f5
parent 9138 b513dc1f7dd5
child 9140 3d8e33a24c31
permissions -rw-r--r--
WinRT: added manual, app-setup instructions to the README A number of other parts of the WinRT README were edited, either for clarity, or to help with Markdown rendering.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9139
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     1
WinRT
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     2
=====
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     3
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     4
SDL/WinRT layer allows SDL2-based applications to run on many of Microsoft's
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     5
platforms that utilize the "Windows Runtime" (aka "WinRT") APIs.  WinRT apps
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     6
are currently always full-screen apps, run in what Microsoft calls their
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     7
"Modern" environment (aka. "Metro"), and are distributed via Microsoft-run
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     8
online stores.  Some of the operating systems that support such apps include:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
     9
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    10
* Windows 8.x
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    11
* Windows RT 8.x (aka. Windows 8.x for ARM processors)
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    12
* Windows Phone 8.x
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    13
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    14
To note, WinRT applications that run on Windows 8.x and/or Windows RT are often
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    15
called "Windows Store" apps.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    16
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    17
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    18
Requirements
9137
b0b056a7b932 WinRT: cleaned up section headers
David Ludwig <dludwig@pobox.com>
parents: 9025
diff changeset
    19
------------
9139
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    20
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    21
- Microsoft Visual C++ 2012 -- Free, "Express" editions may be used, so long
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    22
  as they include support for either "Windows Store" or "Windows Phone" apps.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    23
  (NOTE: MSVC 2013 support is pending.  2012 projects may be converted to 2013
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    24
  projects by MSVC, in the meantime.)
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    25
- A valid Microsoft account -- This requirement is not imposed by SDL, but
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    26
  rather by Microsoft's Visual C++ toolchain.  This is required to debug apps.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    27
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    28
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    29
Setup, High-Level Steps
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    30
-----------------------
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    31
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    32
The steps for setting up a project for an SDL/WinRT app looks like the
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    33
following, at a high-level:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    34
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    35
1. create a new Visual C++ project using Microsoft's template for a,
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    36
   "Direct3D App".
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    37
2. remove most of the files from the project.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    38
3. make your app's project directly reference SDL/WinRT's own Visual C++
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    39
   project file, via use of Visual C++'s "References" dialog.  This will setup
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    40
   the linker, and will copy SDL's .dll files to your app's final output.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    41
4. adjust your app's build settings, at minimum, telling it where to find SDL's
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    42
   header files.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    43
5. add a file that contains a WinRT-appropriate main function.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    44
6. add SDL-specific app code.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    45
7. build and run your app.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    46
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    47
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    48
Setup, Detailed Steps
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    49
---------------------
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    50
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    51
### 1. Create a new project ###
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    52
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    53
Create a new project using one of Visual C++'s templates for a plain, non-XAML,
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    54
"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use).  If you
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    55
don't see one of these templates, in Visual C++'s 'New Project' dialog, try
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    56
using the textbox titled, 'Search Installed Templates' to look for one.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    57
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    58
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    59
### 2. Remove unneeded files from the project ###
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    60
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    61
In the new project, delete any file that has one of the following extensions:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    62
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    63
- .cpp
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    64
- .h
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    65
- .hlsl
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    66
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    67
When you are done, you should be left with a few files, each of which will be a
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    68
necessary part of your app's project.  These files will consist of:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    69
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    70
- an .appxmanifest file, which contains metadata on your WinRT app.  This is
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    71
  similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    72
- a few .png files, one of which is a splash screen (displayed when your app
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    73
  launches), others are app icons.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    74
- a .pfx file, used for code signing purposes.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    75
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    76
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    77
### 3. Add references to SDL's project files ###
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    78
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    79
SDL/WinRT can be built in multiple variations, spanning across three different
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    80
CPU architectures (x86, x64, and ARM) and two different configurations
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    81
(Debug and Release).  WinRT and Visual C++ do not currently provide a means
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    82
for combining multiple variations of one library into a single file.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    83
Furthermore, it does not provide an easy means for copying pre-built .dll files
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    84
into your app's final output (via Post-Build steps, for example).  It does,
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    85
however, provide a system whereby an app can reference the MSVC projects of
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    86
libraries such that, when the app is built:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    87
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    88
1. each library gets built for the appropriate CPU architecture(s) and WinRT
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    89
   platform(s).
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    90
2. each library's output, such as .dll files, get copied to the app's build 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    91
   output.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    92
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    93
To set this up for SDL/WinRT, you'll need to run through the following steps:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    94
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    95
1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    96
   "Solution Explorer")
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    97
2. right click on your app's solution.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    98
3. navigate to "Add", then to "Existing Project..."
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
    99
4. find SDL/WinRT's Visual C++ project file and open it.  Different project
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   100
   files exist for different WinRT platforms.  All of them are in SDL's
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   101
   source distribution, in the following directories:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   102
    * `VisualC-WinRT/WinPhone80_VS2012/` - for Windows Phone 8.0 apps
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   103
    * `VisualC-WinRT/WinPhone81_VS2013/` - for Windows Phone 8.1 apps
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   104
    * `VisualC-WinRT/WinRT80_VS2012/` - for Windows 8.0 apps
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   105
    * `VisualC-WinRT/WinRT81_VS2013/` - for Windows 8.1 apps
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   106
5. once the project has been added, right-click on your app's project and
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   107
   select, "References..."
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   108
6. click on the button titled, "Add New Reference..."
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   109
7. check the box next to SDL
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   110
8. click OK to close the dialog
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   111
9. SDL will now show up in the list of references.  Click OK to close that
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   112
   dialog.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   113
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   114
Your project is now linked to SDL's project, insofar that when the app is
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   115
built, SDL will be built as well, with its build output getting included with
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   116
your app.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   117
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   118
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   119
### 4. Adjust Your App's Build Settings ###
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   120
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   121
Some build settings need to be changed in your app's project.  This guide will
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   122
outline the following:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   123
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   124
- making sure that the compiler knows where to find SDL's header files
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   125
- **(optional for C++, but NECESSARY for compiling C code)** telling the
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   126
  compiler not to use Microsoft's C++ extensions for WinRT development.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   127
- **(OPTIONAL)** telling the compiler not generate errors due to missing
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   128
  precompiled header files.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   129
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   130
To change these settings:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   131
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   132
1. right-click on the project
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   133
2. choose "Properties"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   134
3. in the drop-down box next to "Configuration", choose, "All Configurations"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   135
4. in the drop-down box next to "Platform", choose, "All Platforms"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   136
5. in the left-hand list, expand the "C/C++" section
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   137
6. select "General"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   138
7. edit the "Additional Include Directories" setting, and add a path to SDL's
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   139
   "include" directory
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   140
8. ***Optional: to enable compilation of C code:*** change the setting for
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   141
   "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No".  If you're 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   142
   working with a completely C++ based project, this step can usually be 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   143
   omitted.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   144
9. ***Optional: to disable precompiled headers (which can produce 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   145
   'stdafx.h'-related build errors, if setup incorrectly:*** in the left-hand 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   146
   list, select "Precompiled Headers", then change the setting for "Precompiled 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   147
   Header" from "Use (/Yu)" to "Not Using Precompiled Headers".
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   148
10. close the dialog, saving settings, by clicking the "OK" button
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   149
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   150
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   151
### 5. Add a WinRT-appropriate main function to the app. ###
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   152
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   153
C/C++-based WinRT apps do contain a `main` function that the OS will invoke when 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   154
the app starts launching. The parameters of WinRT main functions are different 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   155
than those found on other platforms, Win32 included.  SDL/WinRT provides a 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   156
platform-appropriate main function that will perform these actions, setup key 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   157
portions of the app, then invoke a classic, C/C++-style main function (that take 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   158
in "argc" and "argv" parameters).  The code for this file is contained inside 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   159
SDL's source distribution, under `src/main/winrt/SDL_winrt_main_NonXAML.cpp`.  
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   160
You'll need to add this file, or a copy of it, to your app's project, and make 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   161
sure it gets compiled using a Microsoft-specific set of C++ extensions called 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   162
C++/CX.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   163
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   164
***NOTE: C++/CX compilation is currently required in at least one file of your 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   165
app's project.  This is to make sure that Visual C++'s linker builds a 'Windows 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   166
Metadata' file (.winmd) for your app.  Not doing so can lead to build errors.***
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   167
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   168
To include `SDL_winrt_main_NonXAML.cpp`:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   169
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   170
1. right-click on your project (again, in Visual C++'s Solution Explorer), 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   171
   navigate to "Add", then choose "Existing Item...".
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   172
2. open `SDL_winrt_main_NonXAML.cpp`, which is found inside SDL's source 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   173
   distribution, under `src/main/winrt/`.  Make sure that the open-file dialog 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   174
   closes, either by double-clicking on the file, or single-clicking on it and 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   175
   then clicking Add.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   176
3. right-click on the file (as listed in your project), then click on 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   177
   "Properties...".
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   178
4. in the drop-down box next to "Configuration", choose, "All Configurations"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   179
5. in the drop-down box next to "Platform", choose, "All Platforms"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   180
6. in the left-hand list, click on "C/C++"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   181
7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)".
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   182
8. click the OK button.  This will close the dialog.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   183
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   184
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   185
### 6. Add app code and assets ###
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   186
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   187
At this point, you can add in SDL-specific source code.  Be sure to include a 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   188
C-style main function (ie: `int main(int argc, char *argv[])`).  From there you 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   189
should be able to create a single `SDL_Window` (WinRT apps can only have one 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   190
window, at present), as well as an `SDL_Renderer`.  Direct3D will be used to 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   191
draw content.  Events are received via SDL's usual event functions 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   192
(`SDL_PollEvent`, etc.)  If you have a set of existing source files and assets, 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   193
you can start adding them to the project now.  If not, or if you would like to 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   194
make sure that you're setup correctly, some short and simple sample code is 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   195
provided below.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   196
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   197
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   198
#### 6.A. ... when creating a new app ####
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   199
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   200
If you are creating a new app (rather than porting an existing SDL-based app), 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   201
or if you would just like a simple app to test SDL/WinRT with before trying to 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   202
get existing code working, some working SDL/WinRT code is provided below.  To 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   203
set this up:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   204
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   205
1. right click on your app's project
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   206
2. select Add, then New Item.  An "Add New Item" dialog will show up.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   207
3. from the left-hand list, choose "Visual C++"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   208
4. from the middle/main list, choose "C++ File (.cpp)"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   209
5. near the bottom of the dialog, next to "Name:", type in a name for your 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   210
source file, such as, "main.cpp".
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   211
6. click on the Add button.  This will close the dialog, add the new file to 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   212
your project, and open the file in Visual C++'s text editor.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   213
7. Copy and paste the following code into the new file (minus the , then save 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   214
it.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   215
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   216
```
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   217
#include <SDL.h>
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   218
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   219
int main(int argc, char **argv)
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   220
{
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   221
    SDL_DisplayMode mode;
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   222
    SDL_Window * window = NULL;
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   223
    SDL_Renderer * renderer = NULL;
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   224
    SDL_Event evt;
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   225
    
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   226
    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   227
        return 1;
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   228
    }
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   229
    
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   230
    if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   231
        return 1;
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   232
    }
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   233
    
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   234
    if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   235
        return 1;
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   236
    }
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   237
    
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   238
    while (1) {
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   239
        while (SDL_PollEvent(&evt)) {
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   240
        }
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   241
        
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   242
        SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   243
        SDL_RenderClear(renderer);
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   244
        SDL_RenderPresent(renderer);
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   245
    }
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   246
}
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   247
```
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   248
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   249
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   250
#### 6.B. Adding code and assets ####
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   251
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   252
If you have existing code and assets that you'd like to add, you should be able 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   253
to add them now.  The process for adding a set of files is as such.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   254
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   255
1. right click on the app's project
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   256
2. select Add, then click on "New Item..."
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   257
3. open any source, header, or asset files as appropriate.  Support for C and 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   258
C++ is available.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   259
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   260
Do note that WinRT only supports a subset of the APIs that are available to 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   261
Win32-based apps.  Many portions of the Win32 API and the C runtime are not 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   262
available.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   263
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   264
A list of unsupported C APIs can be found at 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   265
<http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx>
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   266
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   267
General information on using the C runtime in WinRT can be found at 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   268
<http://msdn.microsoft.com/en-us/LIBRARY/hh972425(v=vs.110).aspx>
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   269
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   270
A list of supported Win32 APIs for Windows 8/RT apps can be found at 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   271
<http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx>.  To note, 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   272
the list of supported Win32 APIs for Windows Phone 8 development is different.  
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   273
That list can be found at 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   274
<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662956(v=vs.105).aspx>
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   275
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   276
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   277
### 7. Build and run your app ###
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   278
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   279
Your app project should now be setup, and you should be ready to build your app.  
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   280
To run it on the local machine, open the Debug menu and choose "Start 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   281
Debugging".  This will build your app, then run your app full-screen.  To switch 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   282
out of your app, press the Windows key.  Alternatively, you can choose to run 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   283
your app in a window.  To do this, before building and running your app, find 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   284
the drop-down menu in Visual C++'s toolbar that says, "Local Machine".  Expand 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   285
this by clicking on the arrow on the right side of the list, then click on 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   286
Simulator.  Once you do that, any time you build and run the app, the app will 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   287
launch in window, rather than full-screen.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   288
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   289
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   290
#### 7.A. Running apps on ARM-based devices ####
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   291
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   292
To build and run the app on ARM-based, "Windows RT" devices, you'll need to:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   293
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   294
- install Microsoft's "Remote Debugger" on the device.  Visual C++ installs and 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   295
  debugs ARM-based apps via IP networks.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   296
- change a few options on the development machine, both to make sure it builds 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   297
  for ARM (rather than x86 or x64), and to make sure it knows how to find the 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   298
  Windows RT device (on the network).
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   299
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   300
Microsoft's Remote Debugger can be found at 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   301
<http://msdn.microsoft.com/en-us/library/vstudio/bt727f1t.aspx>.  Please note 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   302
that separate versions of this debugger exist for different versions of Visual 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   303
C++, one for debugging with MSVC 2012, another for debugging with MSVC 2013.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   304
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   305
To setup Visual C++ to launch your app on an ARM device:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   306
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   307
1. make sure the Remote Debugger is running on your ARM device, and that it's on 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   308
   the same IP network as your development machine.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   309
2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32".  Click 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   310
   it, then change the value to "ARM".
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   311
3. make sure Visual C++ knows the hostname or IP address of the ARM device.  To 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   312
   do this:
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   313
    1. open the app project's properties
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   314
    2. select "Debugging"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   315
    3. next to "Machine Name", enter the hostname or IP address of the ARM 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   316
       device
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   317
    4. if, and only if, you've turned off authentication in the Remote Debugger, then change the setting for "Require Authentication" to No
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   318
    5. click "OK"
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   319
4. build and run the app (from Visual C++).  The first time you do this, a 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   320
   prompt will show up on the ARM device, asking for a Microsoft Account.  You 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   321
   do, unfortunately, need to log in here, and will need to follow the 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   322
   subsequent registration steps in order to launch the app.  After you do so, 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   323
   if the app didn't already launch, try relaunching it again from within Visual 
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   324
   C++.
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   325
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   326
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   327
TODO
9137
b0b056a7b932 WinRT: cleaned up section headers
David Ludwig <dludwig@pobox.com>
parents: 9025
diff changeset
   328
----
9139
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   329
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   330
- Document details of SDL satellite library support
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   331
- Make [NuGet](https://www.nuget.org) packages for SDL/WinRT
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   332
- Create templates for both MSVC 2012 and MSVC 2013, and have the corresponding
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   333
  VSIX packages either include pre-built copies of SDL, or reference binaries
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   334
  available via MSVC's NuGet servers
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   335
    - Write setup instructions that use MSVC 201x templates
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   336
- Write a list of caveats found in SDL/WinRT, such as APIs that don't work due
b2231eba36f5 WinRT: added manual, app-setup instructions to the README
David Ludwig <dludwig@pobox.com>
parents: 9138
diff changeset
   337
  to platform restrictions, or things that need further work