Click or drag to resize
DigitalRuneStep 2: Empty game
Create an XNA game

Let's start by creating an empty XNA game in Visual Studio:

  1. Start Visual Studio 2010.
  2. Select File | New | Project…
  3. Select the Windows Game (4.0) project template.
  4. Choose a name, e.g. MyGame.
  5. Choose a location.
  6. Press OK.
  7. Select Debug | Start Debugging or press F5 to run the game.

You should see an empty game window like this:

Tutorial-01-02

Press ALT+F4 to quit the game.

Let's clean up Game1.cs and remove anything we do not need. Change Game1.cs to this:

Game1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace MyGame
{
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        private GraphicsDeviceManager _graphicsDeviceManager;

        public Game1()
        {
            _graphicsDeviceManager= new GraphicsDeviceManager(this);
        }

        protected override void Initialize()
        {
            base.Initialize();
        }

        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            base.Draw(gameTime);
        }
    }
}

We have an empty XNA game. Next, we start to add DigitalRune Engine features to this project.

Add references to DigitalRune assemblies
  1. In the VS Solution Explorer, right-click the References folder and select Add Reference…
  2. Browse to folder which contains the DigitalRune assemblies for XNA/Windows:
    • <DigitalRune Engine Folder>\References\XNA\Windows
  3. Select all assemblies except the Content Pipeline assemblies and press OK.

Your solution should look like this:

Tutorial-01-03