2023-01-12 20:49:14 +01:00
|
|
|
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-04-06 23:33:32 +02:00
|
|
|
# Compiling for Universal Windows Platform
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-04-06 23:33:32 +02:00
|
|
|
Note that the UWP platform has been removed, as the build and build instructions was unreliable, espacially with containers.
|
|
|
|
This will likely get reversed eventually.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-04-06 23:33:32 +02:00
|
|
|
This page describes how to compile UWP export template binaries from source. If you're looking to export
|
|
|
|
your project to UWP instead, read `doc_exporting_for_uwp`.
|
2022-09-10 12:15:58 +02:00
|
|
|
|
2022-03-18 17:46:08 +01:00
|
|
|
Requirements
|
|
|
|
------------
|
|
|
|
|
2023-01-12 19:29:11 +01:00
|
|
|
- SCons 3.0+ (see `doc_compiling_for_windows` for more details).
|
|
|
|
- Visual Studio 2017 or later. See `doc_compiling_for_windows` about the
|
2022-03-18 17:46:08 +01:00
|
|
|
caveats of installing it and the various prompts.
|
|
|
|
- Windows 10 SDK (can be selected in Visual Studio installation).
|
2023-01-12 20:39:50 +01:00
|
|
|
- `ANGLE source ( https://github.com/Microsoft/angle )`. Use the
|
2023-01-12 19:43:03 +01:00
|
|
|
`ms_master` (default) branch. Keep it in a path without spaces to
|
2022-03-18 17:46:08 +01:00
|
|
|
avoid problems.
|
|
|
|
|
2023-01-12 20:55:57 +01:00
|
|
|
Note:
|
|
|
|
The ANGLE repo by Microsoft has been discontinued and the
|
2023-01-12 19:43:03 +01:00
|
|
|
`ms_master` branch has been cleared out.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
As a temporary workaround however, it is still possible to
|
|
|
|
download an older state of the source code via commit
|
2023-01-12 20:39:50 +01:00
|
|
|
`c61d048 ( https://github.com/microsoft/angle/tree/c61d0488abd9663e0d4d2450db7345baa2c0dfb6 )`.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
This page will eventually be updated in the future to reflect
|
|
|
|
the new build instructions.
|
|
|
|
|
2023-01-12 20:55:57 +01:00
|
|
|
See also:
|
2024-03-16 20:56:52 +01:00
|
|
|
To get the Pandemonium source code for compiling, see
|
2023-01-12 19:29:11 +01:00
|
|
|
`doc_getting_source`.
|
2022-09-10 12:15:58 +02:00
|
|
|
|
2024-03-16 20:56:52 +01:00
|
|
|
For a general overview of SCons usage for Pandemonium, see
|
2023-01-12 19:29:11 +01:00
|
|
|
`doc_introduction_to_the_buildsystem`.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
Compiling
|
|
|
|
---------
|
|
|
|
|
|
|
|
You need to open a proper Visual Studio prompt for the target architecture
|
2023-01-12 19:29:11 +01:00
|
|
|
you want to build. Check `doc_compiling_for_windows` to see how these
|
2022-03-18 17:46:08 +01:00
|
|
|
prompts work.
|
|
|
|
|
|
|
|
There are three target architectures for UWP: x86 (32-bits), x64 (64-bits)
|
2023-01-12 19:43:03 +01:00
|
|
|
and ARM (32-bits). For the latter, you can run `vcvarsall.bat` with
|
|
|
|
`x86_arm` or `amd64_arm` as argument to set the environment.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-01-12 19:43:03 +01:00
|
|
|
Set the `ANGLE_SRC_PATH` to the directory where you downloaded the ANGLE
|
2022-03-18 17:46:08 +01:00
|
|
|
source code. The build process will also build ANGLE to produce the
|
|
|
|
required DLLs for the selected architecture.
|
|
|
|
|
2023-01-12 22:00:14 +01:00
|
|
|
Once you're set, run the SCons command similarly to the other platforms:
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-01-12 22:00:14 +01:00
|
|
|
```
|
2024-03-16 20:56:52 +01:00
|
|
|
C:\pandemonium>scons platform=uwp
|
2023-01-12 22:00:14 +01:00
|
|
|
```
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
Creating UWP export templates
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
To export using the editor you need to properly build package the templates.
|
2023-01-12 19:43:03 +01:00
|
|
|
You need all three architectures with `debug` and `release` templates to
|
2022-03-18 17:46:08 +01:00
|
|
|
be able to export.
|
|
|
|
|
|
|
|
Open the command prompt for one architecture and run SCons twice (once for
|
2023-01-12 22:00:14 +01:00
|
|
|
each target):
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-01-12 22:00:14 +01:00
|
|
|
```
|
2024-03-16 20:56:52 +01:00
|
|
|
C:\pandemonium>scons platform=uwp target=release_debug
|
|
|
|
C:\pandemonium>scons platform=uwp target=release
|
2023-01-12 22:00:14 +01:00
|
|
|
```
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
Repeat for the other architectures.
|
|
|
|
|
2023-01-12 19:43:03 +01:00
|
|
|
In the end your `bin` folder will have the `.exe` binaries with a name
|
2024-03-16 20:56:52 +01:00
|
|
|
like `pandemonium.uwp.opt.debug.32.x86.exe` (with variations for each
|
2022-03-18 17:46:08 +01:00
|
|
|
target/arch).
|
|
|
|
|
2024-03-16 20:56:52 +01:00
|
|
|
Copy one of these to `misc/dist/uwp_template` inside the Pandemonium source
|
|
|
|
folder and rename the binary to `pandemonium.uwp.exe`. From the ANGLE source,
|
2023-01-12 19:43:03 +01:00
|
|
|
under `winrt/10/src/Release_%arch%` (where `%arch%` can be `Win32`,
|
|
|
|
`x64` or `ARM`), get the `libEGL.dll` and the `libGLESv2.dll`,
|
2022-03-18 17:46:08 +01:00
|
|
|
putting them along with the executable.
|
|
|
|
|
2023-01-12 19:43:03 +01:00
|
|
|
Add the files in the `uwp_template` folder to a ZIP. Rename the resulting
|
2023-01-12 22:00:14 +01:00
|
|
|
Zip according to the target/architecture of the template:
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-01-12 22:00:14 +01:00
|
|
|
```
|
2022-03-18 17:46:08 +01:00
|
|
|
uwp_x86_debug.zip
|
|
|
|
uwp_x86_release.zip
|
|
|
|
uwp_x64_debug.zip
|
|
|
|
uwp_x64_release.zip
|
|
|
|
uwp_arm_debug.zip
|
|
|
|
uwp_arm_release.zip
|
2023-01-12 22:00:14 +01:00
|
|
|
```
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2024-03-16 20:56:52 +01:00
|
|
|
Move those templates to the `[versionstring]\templates` folder in Pandemonium
|
|
|
|
settings path, where `versionstring` is the version of Pandemonium you have compiled
|
|
|
|
the export templates for - e.g. `3.0.alpha` for the alpha version of Pandemonium 3.
|
2022-03-18 17:46:08 +01:00
|
|
|
If you don't want to replace the templates, you can set the "Custom Package"
|
|
|
|
property in the export window.
|
|
|
|
|
|
|
|
Running UWP apps with Visual Studio
|
|
|
|
-----------------------------------
|
|
|
|
|
|
|
|
If you want to debug the UWP port or simply run your apps without packaging
|
|
|
|
and signing, you can deploy and launch them using Visual Studio. It might be
|
|
|
|
the easiest way if you are testing on a device such as a Windows Phone or an
|
|
|
|
Xbox One.
|
|
|
|
|
2023-01-12 19:43:03 +01:00
|
|
|
Within the ANGLE source folder, open `templates` and double-click the
|
|
|
|
`install.bat` script file. This will install the Visual Studio project
|
2022-03-18 17:46:08 +01:00
|
|
|
templates for ANGLE apps.
|
|
|
|
|
2024-03-16 20:56:52 +01:00
|
|
|
If you have not built Pandemonium yet, open the `winrt/10/src/angle.sln` solution
|
2022-03-18 17:46:08 +01:00
|
|
|
from the ANGLE source and build it to Release/Win32 target. You may also need
|
|
|
|
to build it for ARM if you plan to run on a device. You can also use MSBuild if
|
|
|
|
you're comfortable with the command line.
|
|
|
|
|
|
|
|
Create a new Windows App project using the "App for OpenGL ES
|
|
|
|
(Windows Universal)" project template, which can be found under the
|
2023-01-12 19:43:03 +01:00
|
|
|
`Visual C++/Windows/Universal` category.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
This is a base project with the ANGLE dependencies already set up. However, by
|
|
|
|
default it picks the debug version of the DLLs which usually have poor
|
|
|
|
performance. So in the "Binaries" filter, click in each of the DLLs there
|
|
|
|
and in the "Properties" window and change the relative path from
|
2023-01-12 19:43:03 +01:00
|
|
|
`Debug_Win32` to `Release_Win32` (or `Release_ARM` for devices).
|
2022-03-18 17:46:08 +01:00
|
|
|
|
|
|
|
In the same "Binaries" filter, select "Add > Existing Item" and point to the
|
2024-03-16 20:56:52 +01:00
|
|
|
Pandemonium executable for UWP you have. In the "Properties" window, set "Content"
|
2023-01-12 19:43:03 +01:00
|
|
|
to `True` so it's included in the project.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-01-12 19:43:03 +01:00
|
|
|
Right-click the `Package.appxmanifest` file and select "Open With... > XML
|
|
|
|
(Text) Editor". In the `Package/Applications/Application` element, replace
|
|
|
|
the `Executable` attribute from `$targetnametoken$.exe` to
|
2024-03-16 20:56:52 +01:00
|
|
|
`pandemonium.uwp.exe` (or whatever your Pandemonium executable is called). Also change
|
|
|
|
the `EntryPoint` attribute to `PandemoniumUWP.App`. This will ensure that
|
|
|
|
the Pandemonium executable is correctly called when the app starts.
|
2022-03-18 17:46:08 +01:00
|
|
|
|
2023-01-12 19:43:03 +01:00
|
|
|
Create a folder (*not* a filter) called `game` in your Visual Studio project
|
2024-03-16 20:56:52 +01:00
|
|
|
folder and there you can put either a `data.pck` file or your Pandemonium project
|
2022-03-18 17:46:08 +01:00
|
|
|
files. After that, make sure to include it all with the "Add > Existing Item"
|
2023-01-12 19:43:03 +01:00
|
|
|
command and set their "Content" property to `True` so they're copied to the
|
2022-03-18 17:46:08 +01:00
|
|
|
app.
|
|
|
|
|
|
|
|
To ease the workflow, you can open the "Solution Properties" and in the
|
|
|
|
"Configuration" section untick the "Build" option for the app. You still have
|
|
|
|
to build it at least once to generate some needed files, you can do so by
|
|
|
|
right-clicking the project (*not* the solution) in the "Solution Explorer" and
|
|
|
|
selecting "Build".
|
|
|
|
|
|
|
|
Now you can just run the project and your app should open. You can also use
|
|
|
|
the "Start Without Debugging" option from the "Debug" menu (or press :kbd:`Ctrl + F5`) to make it
|
|
|
|
launch faster.
|