Check out Bob Familiar's blog here: http://blogs.msdn.com/b/bobfamiliar/
Also, check out our Windows 8 sponsored section.
In part 1 of this series I gave you an overview of MonoGame, an open source cross
platform implementation of the XNA namespace and class model and how you could
use that to port you existing XNA code to Windows 8. In this article, I will
show you how to get your development environment setup to support your
porting effort.
Note: special thanks for Dean Ellis (dellis1972 ) who posted a video on YouTube
outlining this process. I highly recommend that you view Dean’s
video as well as follow the steps below.
|
Developer System Requirements
Install in this order
- Windows 8
Release Preview
- Games for
Windows
- Visual
Studio 2010 Express for Windows Phone
- Visual
Studio 2012 RC for Windows 8
|
NOTE: I encountered an installation failure when
installing the Visual Studio 2010 Express for Windows Phone tools. The XNA
support would fail.
Aaron
Stebner’s directions to download and install the latest version of Games for Windows
fixed the issue. Once that is installed, run the setup for the Visual Studio
2010 Express for Windows Phone and all should go smoothly.
You may be wondering, why do I need Visual Studio 2010? There is a feature of
XNA called the Content Pipeline, a pre-compiler step in the preparation of
graphic and audio assets for use at runtime in XNA. This feature is not yet
implemented in MonoGame. Therefore you need Visual Studio 2010 to pre-compile
your game assets which you then copy over into your VS2012 project. More on
that step in part 3 of this blog series.
|
|
Git Setup
- If you don’t already have one, setup a Git
Account
- Get your self Git Client
|
MonoGame is an open source project managed under Git. In
order to use it you will need to fork the repository from GitHub and then create a clone in your local
environment.
To do that you will need an account on GitHub and a Git Client. I like the
GitHub for Windows client. It has a nice Metro look and feel. It will get you
in the mood to develop for Windows 8

|
After you install the GitHub Windows Client you will have
2 programs available, GitHub (GUI) and Git Shell. The Git Client is a Metro
‘Styled’ desktop application that provides a GUI interface. Git Shell is a
PowerShell based command line interface to Git. We will use Git Shell for our
purposes.


There are a lot of developers who contribute to MonoGame.
The Windows 8 support is being developed by Tom Spillman and James Ford of Sickhead Games as well as
several other talented developers. We will be using their MonoGame Fork. In
particular we will be using the develop3D branch. That is where the Windows 8
support is being submitted.
Note: If you would like to contribute to the Windows8
implementation of MonoGame, contact Tom
Spillman (requires codeplex account)
Cloning the MonoGame Source Code
- Run Git Shell
- Navigate to the location on disk where you want to clone the source code
(use CD command)
- Type the following command to clone the Sickhead fork:

git clone https://github.com/SickheadGames/MonoGame
- Once that command completes, navigate to the MonoGame directory by typing:
CD MonoGame
- Now we will initialize the project submodules by typing
the command:
git submodule init
- And then update the submodules
git submodule update
Create and Deploy the Visual Studio MonoGame Project
Template
- Open an Explorer Window and navigate to the MonoGame
Project directory, then to the templates folder:
C:\Users\[you]\Documents\GitHub\MonoGame\ProjectTemplates\VisualStudio11.MonoGame.2.5\VS11MGWindowsMetroTemplate
- Create a Zip of the all files in this directory
- Copy the ZIP file to this directory
C:\Users\[you]\Documents\Visual
Studio 2012\Templates\ProjectTemplates\Visual
C#


Testing your MonoGame Setup
-
Open Visual Studio 2012 and select New Project
- Under Visual C# you should see the MonoGame project template listed.
Select that and click OK.
- Right click on your solution and add the MonoGame Framework Windows 8
Project. You will find the project file in this directory:
C:\Users\[you]\Documents\GitHub\MonoGame\MonoGame.Framework
The file is called:
MonoGame.Framework.Windows8.sln
- Add a reference to the MonoGame Framework in your game
project by right clicking on references, select Add Reference. Under Projects
choose the MonoGame Framework project and click OK
- Compile and run the solution. You should get a cornflower blue screen (not
a blue screen, a cornflower blue screen, very different!), the default XNA
application.
Now you are ready to add your XNA graphic assets and code. In part 3 of this
blog series I will cover the basic format of an XNA application and my code
migration experience. – bob