FlatRedBall Source

Currently all development is being done on the NetStandard branch, so if you would like to build FlatRedBall Glue form source, we recommend pulling the NetStandard branch. Note that GlueView2 development is being performed on the InGameEditor branch.

The FlatRedBall Game Engine and Tools are all open source. All code is conveniently located in one repository:

FlatRedBall on Github

Downloading FlatRedBall Source

The easiest way to download and keep FlatRedBall source up to date is to use a Github client such as Github for Desktop. To download source using Github for Desktop:

  1. Install Github for Desktop
  2. Select File -> Clone Repository

  3. Select the URL tab
  4. Enter the FlatRedBall url: https://github.com/vchelaru/FlatRedBall
  5. Click the Clone button
  6. Switch to the appropriate branch. The default branch is NetStandard, but you may need to switch to InGameEditor if you are testing GlueView.

After FlatRedBall is cloned, you will have a local copy on your machine.

Adding FlatRedBall Source to a Game Project

If you would like to use the engine source in your game project:

  1. Open your game project in Visual Studio
  2. Expand the game project in the solution explorer
  3. Expand the References item
  4. Find the FlatRedBall entry. This is the reference to the prebuilt-dll

  5. Press the Delete key to remove this reference
  6. Right-click on the solution
  7. Select Add -> Existing Project…
  8. Navigate to the location of the FlatRedBall .csproj file for your given platform. For example, for PC, add <FlatRedBall Root>\Engines\FlatRedBallXNA\FlatRedBall\FlatRedBallDesktopGL.csproj

  9. Click Open to add the project to your game’s solution
  10. Right-click on your game’s References item and select Add Reference…
  11. Click the “Projects” category
  12. Check the FlatRedBallDesktopGL project (or whichever FlatRedBall project used for the given platform)
  13. Click OK

  14. Build and run your project

Building the FlatRedBall Engine

In most cases you will not need to build the FlatRedBall Engine separately – it is usually built either when building Glue, or when building a game project which links the engine (as shown above).

If you need to build the engine separately to obtain the .dll:

  1. Open the file <FlatRedBall Root>\Engines\FlatRedBallXNA\FlatRedBall\FlatRedBallDesktopGL.sln. If you are building for a different platform (such as Android) you will want to select the .sln file for your particular platform.
  2. Verify that your build configuration is Debug, x86 if building for PC
  3. Build the project

Building Glue

Prequisites

As of January 2020, FlatRedBall has a NetStandard branch which builds against .NET Standard/Core. To build this branch, you must have .NET Core 3.0.1 SDK for x86 installed:

https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.0.101-windows-x86-installer

The Glue solutions (.sln files) reference the FlatRedBall engine, so you do not have to open the FlatRedBall engine .sln files first. To build Glue, follow these steps:

  1. Download the FlatRedBall repository (either clone it or download the .zip file from Github)
  2. Download the Gum repository. Make sure to download it to the same folder where you downloaded the FlatRedBall repository, and name the folder Gum. See below for an example.

  3. Open the file <FlatRedBall Root>\FRBDK\Glue\Glue with All.sln.

  4. Verify that your build configuration is Debug, x86
  5. Build the project

It’s important that Gum and FlatRedBall are checked out to the same folder. For example, you may have:

  • c:/MyDocuments/FlatRedBall
  • c:/MyDocuments/Gum

GlueWithGum.sln

The “GlueWithGum.sln” solution includes Glue and the Gum plugin. If you run Glue from Visual Studio, you must first “Build Solution” so that the Gum plugin gets built. Simply debugging (pressing F5) does not build the Gum plugin.

Troubleshooting

Microsoft.Windows.UI.Xaml.CSharp.targets was not found…

When opening the project, you may get a message which states:

The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\8.1\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.CSharp.targets

For information on how to solve this problem, see the following link:

http://www.c-sharpcorner.com/UploadFile/8a67c0/visual-studio-2015-feature-shared-project-part-2/