game/godot

Godot - Compiling for Universal Windows Platform

C/H 2018. 12. 4. 08:30

Compiling for Universal Windows Platform

Requirements

  • SCons (see Compiling for Windows for more details).
    SCons (자세한 내용은 Windows 용 컴파일 참조).
  • Visual Studio 2015 Update 2. It may work with earlier versions. See Compiling for Windows about the caveats of installing it and the various prompts.
    Visual Studio 2015 업데이트 2. 이전 버전에서는 작동 할 수 있습니다. 설치시 주의사항 및 다양한 프롬프트에 대해서는 Windows용 컴파일을 참조하십시오.
  • Windows 10 SDK (can be selected in Visual Studio installation).
    Windows 10 SDK (Visual Studio 설치시 선택할 수 있음).
  • ANGLE source. Use the ms_master (default) branch. Keep it in a path without spaces to avoid problems.
    ANGLE 소스. ms_master (기본값) 분기를 사용하십시오. 문제가 발생하지 않도록 공백없이 경로에 보관하십시오.

Compiling

You need to open a proper Visual Studio prompt for the target architecture you want to build. Check Compiling for Windows to see how these prompts work.
빌드 할 대상 아키텍처에 대해 적절한 Visual Studio 프롬프트를 열어야합니다. 이러한 프롬프트가 작동하는 방식을 보려면 Windows 용 컴파일을 확인하십시오.

There are three target architectures for UWP: x86 (32-bits), x64 (64-bits) and ARM (32-bits). For the latter, you can run vcvarsall.bat with x86_arm or amd64_arm as argument to set the environment.
UWP에는 x86(32 비트), x64 (64 비트) 및 ARM (32 비트)의 세 가지 대상 아키텍처가 있습니다. 후자의 경우, vcvarsall.bat를 x86_arm 또는 amd64_arm을 인수로 사용하여 환경을 설정할 수 있습니다.

Set the ANGLE_SRC_PATH to the directory where you downloaded the ANGLE source code. The build process will also build ANGLE to produce the required DLLs for the selected architecture.
ANGLE_SRC_PATH를 ANGLE 소스 코드를 다운로드 한 디렉토리로 설정하십시오. 빌드 프로세스는 ANGLE을 빌드하여 선택한 아키텍처에 필요한 DLL을 생성합니다.

Once you're set, run the SCons command similarly to the other platforms:
일단 설정을 마치면 다른 플랫폼과 마찬가지로 SCons 명령을 실행하십시오 :

C:\godot<scons platform=uwp

Creating UWP export templates

To export using the editor you need to properly build package the templates. You need all three architectures with debug and release templates to be able to export.
편집기를 사용하여 내보내려면 템플리트 패키지를 올바르게 빌드해야합니다. 내보낼 수 있으려면 디버그 및 릴리스 템플릿이있는 세 가지 아키텍처가 모두 필요합니다.

Open the command prompt for one architecture and run SCons twice (once for each target):
하나의 아키텍처에 대한 명령 프롬프트를 열고 SCons를 두 번 실행합니다 (각 대상에 대해 한 번).

C:\godot<scons platform=uwp target=release_debug
C:\godot<scons platform=uwp target=release

Repeat for the other architectures.
다른 아키텍처에 대해서도 반복하십시오.

In the end your bin folder will have the .exe binaries with a name like godot.uwp.opt.debug.32.x86.exe (with variations for each target/arch).
결국 bin 폴더에는 godot.uwp.opt.debug.32.x86.exe와 같은 이름의 .exe 바이너리가 있습니다 (각 target/arch에 대한 변형이 있음).

Copy one of these to misc/dist/uwp_template inside the Godot source folder and rename the binary to godot.uwp.exe. From the ANGLE source, under winrt/10/src/Release_%arch% (where %arch% can be Win32, x64 or ARM), get the libEGL.dll and the libGLESv2.dll, putting them along with the executable.
이 중 하나를 Godot 소스 폴더 내의 misc/dist/uwp_template에 복사하고 이진 파일의 이름을 godot.uwp.exe로 바꿉니다. ANGLE 소스에서 winrt /10/src/Release_%arch% (여기서 %arch%는 Win32, x64 또는 ARM이 될 수 있음)에서 libEGL.dll 및 libGLESv2.dll을 가져 와서 실행 파일과 함께 저장합니다.

Add the files in the uwp_template folder to a ZIP. Rename the resulting Zip according to the target/architecture of the template:
uwp_template 폴더의 파일을 ZIP에 추가하십시오. 템플릿의 target/archiecture에 따라 결과 Zip의 이름을 바꿉니다.

uwp_x86_debug.zip
uwp_x86_release.zip
uwp_x64_debug.zip
uwp_x64_release.zip
uwp_arm_debug.zip
uwp_arm_release.zip

Move those templates to the [versionstring]\templates folder in Godot settings path, where versionstring is the version of Godot you have compiled the export templates for - e.g. 3.0.alpha for the alpha version of Godot 3. If you don't want to replace the templates, you can set the "Custom Package" property in the export window.
해당 템플릿을 Godot 설정 경로의 [versionstring]\templates 폴더로 이동합니다. 여기서 versionstring은 내보내기 템플릿을 컴파일 한 Godot의 버전입니다 (예 : 3. Godot 알파 버전의 경우 3.0.alpha입니다. 템플릿을 바꾸지 않으려면 내보내기 윈도우에서 "Custom Package"속성을 설정할 수 있습니다.

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.
UWP 포트를 디버깅하거나 패키지 및 서명없이 앱을 실행하려면 Visual Studio를 사용하여 배포하고 실행할 수 있습니다. Windows Phone 또는 Xbox One과 같은 장치에서 테스트하는 경우 가장 쉬운 방법 일 수 있습니다.

Within the ANGLE source folder, open templates and double-click the install.bat script file. This will install the Visual Studio project templates for ANGLE apps.
ANGLE 소스 폴더에서 템플리트를 열고 install.bat 스크립트 파일을 두 번 클릭하십시오. 그러면 ANGLE 응용 프로그램 용 Visual Studio 프로젝트 템플릿이 설치됩니다.

If you have not built Godot yet, open the winrt/10/src/angle.sln solution 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.
Godot을 아직 만들지 않았다면 ANGLE 소스에서 winrt/10/src/angle.sln 솔루션을 열고 Release/Win32 타겟으로 빌드하십시오. 장치에서 실행하려는 경우 ARM 용으로 빌드해야 할 수도 있습니다. 명령 줄에 익숙하다면 MSBuild를 사용할 수도 있습니다.

Create a new Windows App project using the "App for OpenGL ES (Windows Universal)" project template, which can be found under the Visual C++/Windows/Universal category.
Visual C++/Windows/Universal 카테고리에서 찾을 수있는 "OpenGL ES 용 응용 프로그램 (Windows Universal)"프로젝트 템플릿을 사용하여 새 Windows 응용 프로그램 프로젝트를 만듭니다.

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 Debug_Win32 to Release_Win32 (or Release_ARM for devices).
ANGLE 종속성이 이미 설정된 기본 프로젝트입니다. 그러나 기본적으로 성능이 떨어지는 DLL의 디버그 버전을 선택합니다. 따라서 "Binaries"필터의 "Properties"창에있는 각 DLL을 클릭하고 Debug_Win32에서 Release_Win32 (또는 장치의 경우 Release_ARM)로 상대 경로를 변경하십시오.

In the same "Binaries" filter, select "Add > Existing Item" and point to the Godot executable for UWP you have. In the "Properties" window, set "Content" to True so it's included in the project.
같은 "Binaries"필터에서 "Add> Existing Item"을 선택하고 가지고있는 UWP 용 Godot 실행 파일을 가리 킵니다. "Properties"창에서 "Content"를 True로 설정하여 프로젝트에 포함시킵니다.

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 godot.uwp.exe (or whatever your Godot executable is called). Also change the EntryPoint attribute to GodotUWP.App. This will ensure that the Godot executable is correctly called when the app starts.
Package.appxmanifest 파일을 마우스 오른쪽 버튼으로 클릭하고 "연결 프로그램 ...> XML (텍스트) 편집기"를 선택하십시오. Package/Applications/Application 요소에서 $targetnametoken$.exe의 실행 파일 특성을 godot.uwp.exe (또는 Godot 실행 파일이 무엇이든간에)로 바꿉니다. 또한 EntryPoint 특성을 GodotUWP.App로 변경하십시오. 이렇게하면 응용 프로그램이 시작될 때 Godot 실행 파일이 올바르게 호출되도록 할 수 있습니다.

Create a folder (not a filter) called game in your Visual Studio project folder and there you can put either a data.pck file or your Godot project files. After that, make sure to include it all with the "Add > Existing Item" command and set their "Content" property to True so they're copied to the app.
Visual Studio 프로젝트 폴더에 게임이라는 폴더 (필터가 아닙니다)를 만들고 거기에 data.pck 파일이나 Godot 프로젝트 파일을 둘 수 있습니다. 그런 다음 "Add> Existing Item"명령을 모두 포함하고 응용 프로그램에 복사되도록 "Content"속성을 True로 설정하십시오.

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".
워크 플로를 쉽게하기 위해 "Solution Properties"을 열고 "Configuration"섹션에서 응용 프로그램의 "Build"옵션을 선택 취소하십시오. 필요한 파일을 생성하려면 적어도 한 번 이상 빌드해야합니다. 솔루션 탐색기에서 프로젝트를 마우스 오른쪽 단추로 클릭하고 "Build"를 선택하면됩니다.

Now you can just run the project and your app should open. You can use also the "Start Without Debugging" from the "Debug" menu (Ctrl+F5) to make it launch faster.
이제 프로젝트를 실행하면 앱이 열립니다. 디버그 메뉴 (Ctrl + F5)에서 "Start Without Debugging"을 사용하여 실행 속도를 빠르게 할 수 있습니다.

반응형

'game > godot' 카테고리의 다른 글

Godot - Compiling for iOS  (0) 2018.12.06
Godot - Cross-compiling for iOS on Linux  (0) 2018.12.05
Godot - Compiling for the Web  (0) 2018.12.03
Godot - Compiling with Mono  (0) 2018.12.01
Godot - Packaging Godot  (0) 2018.11.30