|
3 | 3 | Compiling for Universal Windows Platform |
4 | 4 | ======================================== |
5 | 5 |
|
6 | | -.. highlight:: shell |
| 6 | +.. important:: |
7 | 7 |
|
8 | | -.. seealso:: |
| 8 | + Compiling UWP export templates is not implemented in Godot 4. |
| 9 | + Godot 3 has limited UWP support, but there are many |
| 10 | + `known issues <https://github.com/godotengine/godot/issues?q=is%3Aopen+is%3Aissue+label%3Aplatform%3Auwp>`__. |
9 | 11 |
|
10 | | - This page describes how to compile UWP export template binaries from source. |
11 | | - If you're looking to export your project to UWP instead, read :ref:`doc_exporting_for_uwp`. |
12 | | - |
13 | | -Requirements |
14 | | ------------- |
15 | | - |
16 | | -- `Python 3.6+ <https://www.python.org/downloads/windows/>`_. |
17 | | - **Make sure to enable the option to add Python to the ``PATH`` in the installer.** |
18 | | -- `SCons 3.0+ <https://scons.org/pages/download.html>`_ build system. Using the |
19 | | - latest release is recommended, especially for proper support of recent Visual |
20 | | - Studio releases. |
21 | | -- Windows 10 SDK (can be selected in Visual Studio installation). |
22 | | -- `ANGLE source <https://github.com/Microsoft/angle>`__. Use the |
23 | | - ``ms_master`` (default) branch. Keep it in a path without spaces to |
24 | | - avoid problems. |
25 | | - |
26 | | -.. note:: The ANGLE repo by Microsoft has been discontinued and the |
27 | | - ``ms_master`` branch has been cleared out. |
28 | | - |
29 | | - As a temporary workaround however, it is still possible to |
30 | | - download an older state of the source code via commit |
31 | | - `c61d048 <https://github.com/microsoft/angle/tree/c61d0488abd9663e0d4d2450db7345baa2c0dfb6>`__. |
32 | | - |
33 | | - This page will eventually be updated in the future to reflect |
34 | | - the new build instructions. |
35 | | - |
36 | | -.. seealso:: To get the Godot source code for compiling, see |
37 | | - :ref:`doc_getting_source`. |
38 | | - |
39 | | - For a general overview of SCons usage for Godot, see |
40 | | - :ref:`doc_introduction_to_the_buildsystem`. |
41 | | - |
42 | | -Compiling |
43 | | ---------- |
44 | | - |
45 | | -You need to open a proper Visual Studio prompt for the target architecture |
46 | | -you want to build. Check :ref:`doc_compiling_for_windows` to see how these |
47 | | -prompts work. |
48 | | - |
49 | | -There are three target architectures for UWP: x86 (32-bits), x64 (64-bits) |
50 | | -and ARM (32-bits). For the latter, you can run ``vcvarsall.bat`` with |
51 | | -``x86_arm`` or ``amd64_arm`` as argument to set the environment. |
52 | | - |
53 | | -Set the ``ANGLE_SRC_PATH`` to the directory where you downloaded the ANGLE |
54 | | -source code. The build process will also build ANGLE to produce the |
55 | | -required DLLs for the selected architecture. |
56 | | - |
57 | | -Once you're set, run the SCons command similarly to the other platforms:: |
58 | | - |
59 | | - C:\godot>scons platform=uwp |
60 | | - |
61 | | -Creating UWP export templates |
62 | | ------------------------------ |
63 | | - |
64 | | -To export using the editor you need to properly build package the templates. |
65 | | -You need all three architectures with ``debug`` and ``release`` templates to |
66 | | -be able to export. |
67 | | - |
68 | | -Open the command prompt for one architecture and run SCons twice (once for |
69 | | -each target):: |
70 | | - |
71 | | - C:\godot>scons platform=uwp target=template_debug |
72 | | - C:\godot>scons platform=uwp target=template_release |
73 | | - |
74 | | -Repeat for the other architectures. |
75 | | - |
76 | | -In the end your ``bin`` folder will have the ``.exe`` binaries with a name |
77 | | -like ``godot.uwp.opt.debug.32.x86.exe`` (with variations for each |
78 | | -target/arch). |
79 | | - |
80 | | -Copy one of these to ``misc/dist/uwp_template`` inside the Godot source |
81 | | -folder and rename the binary to ``godot.uwp.exe``. From the ANGLE source, |
82 | | -under ``winrt/10/src/Release_%arch%`` (where ``%arch%`` can be ``Win32``, |
83 | | -``x64`` or ``ARM``), get the ``libEGL.dll`` and the ``libGLESv2.dll``, |
84 | | -putting them along with the executable. |
85 | | - |
86 | | -Add the files in the ``uwp_template`` folder to a ZIP. Rename the resulting |
87 | | -Zip according to the target/architecture of the template:: |
88 | | - |
89 | | - uwp_x86_debug.zip |
90 | | - uwp_x86_release.zip |
91 | | - uwp_x64_debug.zip |
92 | | - uwp_x64_release.zip |
93 | | - uwp_arm_debug.zip |
94 | | - uwp_arm_release.zip |
95 | | - |
96 | | -Move those templates to the ``[versionstring]\templates`` folder in Godot |
97 | | -settings path, where `versionstring` is the version of Godot you have compiled |
98 | | -the export templates for - e.g. `3.0.alpha` for the alpha version of Godot 3. |
99 | | -If you don't want to replace the templates, you can set the "Custom Package" |
100 | | -property in the export window. |
101 | | - |
102 | | -Running UWP apps with Visual Studio |
103 | | ------------------------------------ |
104 | | - |
105 | | -If you want to debug the UWP port or simply run your apps without packaging |
106 | | -and signing, you can deploy and launch them using Visual Studio. It might be |
107 | | -the easiest way if you are testing on a device such as a Windows Phone or an |
108 | | -Xbox One. |
109 | | - |
110 | | -Within the ANGLE source folder, open ``templates`` and double-click the |
111 | | -``install.bat`` script file. This will install the Visual Studio project |
112 | | -templates for ANGLE apps. |
113 | | - |
114 | | -If you have not built Godot yet, open the ``winrt/10/src/angle.sln`` solution |
115 | | -from the ANGLE source and build it to Release/Win32 target. You may also need |
116 | | -to build it for ARM if you plan to run on a device. You can also use MSBuild if |
117 | | -you're comfortable with the command line. |
118 | | - |
119 | | -Create a new Windows App project using the "App for OpenGL ES |
120 | | -(Windows Universal)" project template, which can be found under the |
121 | | -``Visual C++/Windows/Universal`` category. |
122 | | - |
123 | | -This is a base project with the ANGLE dependencies already set up. However, by |
124 | | -default it picks the debug version of the DLLs which usually have poor |
125 | | -performance. So in the "Binaries" filter, click in each of the DLLs there |
126 | | -and in the "Properties" window and change the relative path from |
127 | | -``Debug_Win32`` to ``Release_Win32`` (or ``Release_ARM`` for devices). |
128 | | - |
129 | | -In the same "Binaries" filter, select "Add > Existing Item" and point to the |
130 | | -Godot executable for UWP you have. In the "Properties" window, set "Content" |
131 | | -to ``True`` so it's included in the project. |
132 | | - |
133 | | -Right-click the ``Package.appxmanifest`` file and select "Open With... > XML |
134 | | -(Text) Editor". In the ``Package/Applications/Application`` element, replace |
135 | | -the ``Executable`` attribute from ``$targetnametoken$.exe`` to |
136 | | -``godot.uwp.exe`` (or whatever your Godot executable is called). Also change |
137 | | -the ``EntryPoint`` attribute to ``GodotUWP.App``. This will ensure that |
138 | | -the Godot executable is correctly called when the app starts. |
139 | | - |
140 | | -Create a folder (*not* a filter) called ``game`` in your Visual Studio project |
141 | | -folder and there you can put either a ``data.pck`` file or your Godot project |
142 | | -files. After that, make sure to include it all with the "Add > Existing Item" |
143 | | -command and set their "Content" property to ``True`` so they're copied to the |
144 | | -app. |
145 | | - |
146 | | -To ease the workflow, you can open the "Solution Properties" and in the |
147 | | -"Configuration" section untick the "Build" option for the app. You still have |
148 | | -to build it at least once to generate some needed files, you can do so by |
149 | | -right-clicking the project (*not* the solution) in the "Solution Explorer" and |
150 | | -selecting "Build". |
151 | | - |
152 | | -Now you can just run the project and your app should open. You can also use |
153 | | -the "Start Without Debugging" option from the "Debug" menu (or press :kbd:`Ctrl + F5`) to make it |
154 | | -launch faster. |
| 12 | + We recommend you use the :ref:`Win32 export <doc_exporting_for_windows>` instead. |
0 commit comments