compiling_for_universal_windows_apps.rst 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. .. _doc_compiling_for_universal_windows_apps:
  2. Compiling for Universal Windows Apps
  3. ====================================
  4. .. highlight:: shell
  5. This page documents the current state of the "winrt" platform, used to
  6. support "Windows Store Apps" for Windows 8.1, and Windows Phone 8.1 apps
  7. using Microsoft's new "Universal" APIs.
  8. Requirements
  9. ------------
  10. - Windows 8
  11. - SCons (see :ref:`doc_compiling_for_windows` for more details)
  12. - Visual Studio 2013 for Windows (but *not* "for Windows Desktop").
  13. Tested on "Microsoft Visual Studio Express 2013 for Windows Version
  14. 12.0.31101.00 Update 4".
  15. Compiling
  16. ---------
  17. The platform can compile binaries for both Windows 8.1 and Windows Phone
  18. 8.1. The architecture is decided by the environment variable "PLATFORM".
  19. Windows 8.1
  20. ~~~~~~~~~~~
  21. - Open a "VS 2013 x64 Cross Tools Command Prompt"
  22. - The value of environment variable "PLATFORM" should be "x64"
  23. - Run scons with ``platform=winrt`` from the root of the source tree::
  24. C:\godot_source> scons platform=winrt
  25. - You should get an executable file inside bin/ named according to your
  26. build options, for the architecture "x64", for example
  27. "godot.winrt.tools.x64.exe".
  28. Windows Phone 8.1
  29. ~~~~~~~~~~~~~~~~~
  30. - Open a "Visual Studio 2012 ARM Phone Tools Command Prompt"
  31. - The value of environment variable "PLATFORM" should be "arm"
  32. - Run scons with ``platform=winrt`` from the root of the source tree::
  33. C:\godot_source> scons platform=winrt
  34. - You should get an executable file inside bin/ named according to your
  35. build options, for the architecture "arm", for example
  36. "godot.winrt.tools.arm.exe".
  37. Running
  38. -------
  39. On Visual studio, create a new project using any of the "Universal App"
  40. templates found under Visual C++ -> Store Apps -> Universal Apps. "Blank
  41. App" should be fine.
  42. On the "Solution Explorer" box, you should have 3 sections, "App.Windows
  43. (Windows 8.1)", "App.WindowsPhone (Windows Phone 8.1)" and "App.Shared".
  44. You need to add files to each section:
  45. App.Shared
  46. ~~~~~~~~~~
  47. Add a folder named "game" containing your game content (can be individual
  48. files or your data.pck). Remember to set the "Content" property of each
  49. file to "True", otherwise your files won't get included in the package.
  50. App.Windows
  51. ~~~~~~~~~~~
  52. - Add your windows executable, and all the .dll files found on
  53. platform/winrt/x64/bin on the godot source. Remember to also set the
  54. "Content" property.
  55. - Find the file "Package.appxmanifest". Right click on it and select
  56. "Open with..." then "XML (Text) Editor" from the list.
  57. - Find the "Application" section, and add (or modify) the "Executable"
  58. property with the name of your .exe. Example:
  59. ::
  60. <Application Id="App" Executable="godot.winrt.tools.x64.exe" EntryPoint="App_Windows.App">
  61. App.WindowsPhone
  62. ~~~~~~~~~~~~~~~~
  63. Repeat all the steps from App.Windows, using your arm executable and
  64. the dlls found in platform/winrt/arm/bin. Remember to set the
  65. "Content" property for all the files.
  66. Use the green "Play" button on the top to run. The drop down menu next
  67. to it should let you choose the project (App.Windows or
  68. App.WindowsPhone) and the device ("Local Machine", "Device" for an
  69. attached phone, etc).
  70. Angle
  71. -----
  72. ANGLE precompiled binaries are provided on platform/winrt/x64 and
  73. platform/winrt/arm. They are built from MSOpenTech's "future-dev"
  74. branch, found here: https://github.com/MSOpenTech/angle. The visual
  75. studio 'solutions' used are found on ``projects/winrt/windows/angle.sln``
  76. and ``projects/winrt/windowsphone/angle.sln``.
  77. What's missing
  78. --------------
  79. - Audio
  80. - Semaphores
  81. - Keyboard input
  82. - Proper handling of screen rotation
  83. - Proper handling of other events such as focus lost, back button, etc.
  84. - Packaging and deploying to devices from the editor.
  85. - Adding Angle to our tree and compiling it from there. The same source
  86. could also be used to build for Windows (and use Angle instead of
  87. native GL, which will be more compatible with graphics hardware)
  88. Packages
  89. --------
  90. This is what we know:
  91. - App packages are documented here:
  92. http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh464929.aspx
  93. - There are 2 command line tools that might be useful, `App Packager
  94. <http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh446767.aspx>`__
  95. and `SignTool
  96. <http://msdn.microsoft.com/en-us/library/windows/apps/xaml/ff551778.aspx>`__.
  97. - There are a bunch of tools on "powershell" that deal with packages
  98. that might be relevant:
  99. http://technet.microsoft.com/library/dn448373.aspx
  100. - When running a Windows 8.1 app on "Local Machine" from Visual studio,
  101. the app seems to run from an uncompressed directory on the filesystem
  102. in an arbitrary location (ie. outside of the proper directory where
  103. Apps are installed), but there is some special registry entry made
  104. for it, so we know it's possible to skip the packaging step to run
  105. locally (in the case of very big games this can be useful).