Skip to content

Tutorials:Getting Started Guide Windows

Voll3r edited this page Oct 29, 2012 · 3 revisions

Back to Tutorials Page

Table of Contents

Introduction

This page gives an introduction for how to get started with MonoGame on Windows. The following steps are covered:

  1. Getting and installing MonoDevelop and MonoGame
  2. Setting up an application with MonoGame (stable)
  3. Downloading an compiling the latest source files for MonoGame (develop3d)
  4. Setting up an application with MonoGame (develop3d)
  5. Updating the source files
These steps are demonstrated on a Windows 7 machine. There may be some differences with other versions of Windows, but the main steps are largely the same.

Installation

  1. Go to http://www.monodevelop.com and download the windows installer. If they are not already installed on your system, also get the files for .NET Framework and GTK# for .NET
  2. Run the downloaded files and follow the instructions.
MonoDevelop is now installed and we will install MonoGame next.
  1. Head to the official MonoGame website (http://www.monogame.codeplex.com)
  2. Go to the Downloads tab and download the MonoGame 2.5.1 Windows Installer.
  3. Run the file and follow the instructions.
MonoGame is now installed and we are ready to create our first application.

Creating a MonoGame Application (stable version)

  1. Launch MonoDevelop from your start menu or desktop shortcut.
  2. Create a new project, or solution, by choosing File -> New -> Solution from the drop-down menus.
  3. If you have used your package manager for installation, you will find that there already is a template available for MonoGame solutions under Windows: C# -> MonoGame -> MonoGame Windows Application.
  4. Select a suitable name and location for your solution, press Forward, and choose OK on the following dialogue.
Creating a new solution

You now have a working solution already set up with the required references for a MonoGame application to work. In principle you can compile and run the application as is. However, you may want to set

graphics.IsFullScreen = false

while familiarising yourself with the IDE.

To launch the application, press F5 or select Run -> Start Debugging.

Getting and Building the Latest Sources (develop3d)

We will be using the Version Control plugin of MonoDevelop as a convenient way to download the latest MonoGame sources.

  1. From the drop-down menu select Version Control -> Checkout.
  2. Enter the path to the MonoGame git repository into the Url field (git://github.com/mono/MonoGame.git) and choose a target directory for the files to be checked out into. Press OK. align=center
  3. Open the MonoGame Windows solution of MonoGame by choosing File -> Open and selecting the MonoGame.Framework.Windows.sln in the target location specified by you during checkout.
  4. Set the Active Configuration drop-down box from Debug to Release and build the complete solution by hitting F8 or selecting Build -> Build All. align=center
  5. If there are no errors, you have successfully built the MonoGame .dll files. You can now go on and include them in your project. How this step works is described in the next part.

Creating a MonoGame Application (develop3d version)

Creating a MonoGame solution using the current develop3d version works almost the same way as creating one that is using the stable version. The only difference is that we exchange the .dll files that are used with those of the develop3d version which we have compiled in the previous step.

  1. Create a new solution from the MonoGame Windows Application template as shown previously.
  2. In order to exchange the .dll files, we need to adjust the respective references to these files. To do so, right-click on the References item in the solution tree and select Edit References, or choose Project -> Edit References from the drop-down menu. align=center
  3. Delete the following items from the list
    • MonoGame.Framework.Linux
    • Lidgren.Network
    • Tao.Sdl
    align=center
  4. Replace them with the ones we compiled previously by choosing the .Net Assembly tab, browsing into your MonoGame.Framework/bin/Release/ folder and adding the .dll files found therein. align=center
Your solution is now using the .dll files from the develop3d version of MonoGame.

Keeping the Sources Up-to-date

You can use the Version Control plugin of MonoDevelop to keep up-to-date with the latest changes in the develop3d version of MonoGame.

  1. Open the MonoGame.Framework.Linux.sln
  2. Choose Version Control -> Update Solution from the drop-down menu. Doing so will update the solution to the latest one available from the repository.
  3. In order for your own application to use that latest version, build the MonoGame solution once more.
Updating the references in your application is not necessary, as MonoDevelop will find the new .dll files in the same place as before.

Back to Tutorials Page