### Exercise 7: Using the ANGLE NuGet Package ###
The recommended way to use ANGLE is to add it to your Visual Studio project using NuGet. However, the ANGLE project currently does not provide a template that uses NuGet. It is relatively easy to modify the Visual Studio project to use the NuGet version of ANGLE. Using the NuGet version of ANGLE has the following advantages:
- The builds released to NuGet have been tested by the ANGLE team and are considered stable releases.
- The NuGet builds are referenced builds that can be used by the ANGLE team for investigating issues you may report.
- The NuGet packages are easier to add to your project and save you the time of having to build ANGLE from source.
In this exercise you will complete the following steps:
- Modify the Breakout project to remove references to the prebuilt version of ANGLE.
- Use Nuget to add ANGLE to your project.
The default ANGLE Visual Studio templates add references to the prebuilt versions of ANGLE that have been installed on your computer. Before we can add ANGLE using nuget, we need remove these references from the Breakout project file.
-
Open Breakout.sln in the CodeLabs/Workshops/Games/Module3-ANGLE/Source/Ex7/Begin folder.
-
Select Debug x86 from the Project Configuration and Platform menus.
Configuring the build target
-
Right click on the Breakout project file and select Unload Project from the menu.
Unload project
-
Right click on the Breakout project and select Edit
Edit project
-
Search for the word Angle and remove the following lines from the .vcxproj file:
<PropertyGroup Label="ANGLE"> <AngleIncPath Condition=" '$(AngleIncPath)' == '' ">$(AngleRootPath)\include\</AngleIncPath> <AngleBinPath Condition=" '$(AngleBinPath)' == '' ">$(AngleRootPath)\winrt\10\src\$(Configuration)_$(Platform)\</AngleBinPath> </PropertyGroup> <ItemGroup Label="ANGLE"> <None Include="$(AngleBinPath)libEGL.dll"> <DeploymentContent>true</DeploymentContent> </None> <None Include="$(AngleBinPath)libGLESv2.dll"> <DeploymentContent>true</DeploymentContent> </None> </ItemGroup>
-
Search for $(AngleIncPath) and carefully remove the following references without breaking the XML
Modify all instances of:
<AdditionalIncludeDirectories>$(AngleIncPath);$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
to:
<AdditionalIncludeDirectories>$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
Also modify all instances of:
<AdditionalDependencies>$(AngleBinPath)lib\libGLESv2.lib;$(AngleBinPath)lib\libEGL.lib;mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
to:
<AdditionalDependencies>mincore.lib;%(AdditionalDependencies)</AdditionalDependencies>
-
Right click on the Breakout project and reload the project
Reload project
-
Right click on the project and select Manage NuGet Packages…
Manage NuGet Packages
-
Click on Browse and then search for ANGLE.WindowsStore. Select ANGLE.WindowsStore in the search results, then click on Install
ANGLE NuGet package
-
Close the Nuget Window. Press F5 to build your project. It should now look like the following:
Breakout App
You have now modified the Breakout project to use NuGet to add ANGLE to the project. This is the recommended method for adding ANGLE to a Visual Studio project.
Please note that the above changes will also need to be performed on the soil project as it also needs to access the ANGLE header files. Repeat the above steps to modify the soil project.
This completes the ANGLE workshop.
- Return to Start