Codeplex Project – XNA Game Input Component

An new project has been Started on CodePlex called XGameInput, this component is a small component the uses all of the main input functions for XNA and drops them into one common component. Here is the link to the CodePlex Project page.

“What is it ?
XGameInput is a GameComponent for the XNA framework that provides the programmer with
a single point of access to user control input via a XBox 360 gamepad, keyboard or mouse.

How does it work ?
The component is partially based on the gamepad helper files provided by Microsoft as
part of the SpaceWars starter kit but with the addition of mouse and keyboard support.
The component allows the user to create named control inputs and assign these named
inputs to a control source.”

For more information drop over to the CodePlex page and check it out.

Cross Post from Virtual Realm – Mykre’s Space

XNA Wiki Project

A couple of community Members have started an XNA Wiki Project and have asked for community support and content to help the resource grow. Here is the link to the request on the MSDN XNA Forums Site.

Me and a few friends have started a XNA Wiki project for the community…please stop by and contribute any expertise you can lend to make this a good source for the community for quick reference to everything from theories, to simple and easy to understand documentation on XNA. We’re hard at work this week expanding the XNA section. If you have a XNA tutorial or community website, please be sure to drop a link off on the page too!”

For those who are interested here is the link to the New Wiki Site.

Cross Post from Virtual Realm – Mykre’s Space

My version of XNA Pong

Looking over the posts and samples for the XNA System, it seems to be that everyone is doing a version of Pong… So I thought that I would give it a go.

At the moment the code is ruff and only the base fuctions are there, bt it does work and it is complete. Over the next few days I will try to fix it up and add some of my own thoughts to the program. For the moment all I leave you with is the screen shot and some of the things I am going to add.


  • Add the ability for the user to use the Keyboard and Controllers
  • Change the graphics…
  • Add game states so that you have a start, playing, and end states… maybe more.
  • Add sound.

Cross Post from Virtual Realm – Mykre’s Space

Good bye Managed DirectX 2 (MDX2)

“The MDX 2.0 beta libraries will cease to function after October 5th, 2006.  That’s 15 days from now.”, David Weller…

David Weller has made a post today which details the furtue of Managed DirectX 2.0. Thos who are currently using the system and have products that they plan to release that use the MDX2 system really need to read this post. Note that the Managed DirectX 2.0 system is and allways has been only a beta release and should not be used for systems or applications that are planned for production.

Options Moving Forward… from Davids Blog post,

  1. Revert your MDX 2.0 dependencies back to MDX 1.1.  This is by-far the easiest approach, and the MDX 1.1 libraries aren’t going to “disappear” for a long time.  In addition, they work just fine with the .NET 2.0 runtime (many people thought that you needed to migrate to MDX 2.0 in order to run in the .NET 2.0 runtime, but that was nowhere near the truth).
  2. Migrate your application to the XNA Framework, using the handy migration guide published by Rick Hoskinson (Caveat: It’s aimed at MDX 1.1, so there’s some jiggling you have to do)

For those that are going to start converting their code please remember that you can always ask questions in the XNA Forums on the MSDN Site, The guys there are more then willing to help.

Cross Post from Virtual Realm – Mykre’s Space

XNA Mouse Interface Component

This being friday evening with the wife out and the kids in Bed I have had a small ammount of time to play some more with the XNA Systems. With some of the projects that I am moving with I needed to have a basic UI System, so I have started to put one together. The first part was to get a mouse interface running. I know that in the furture if I did want to migrate my code for the Xbox 360 I would not be able to use the mouse. But for the moment this interface gives me the choice of developing on my Laptop when I can, and with the use of the component system I should then just be able to swap it out for the Controller Interface (Comming soon).

Now the code I have is pretty simple but I will be expanding on it, if others have some more ideas on it please post so that I can grow the interface component.

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Components;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;

namespace MouseTest
public partial class MouseInterface : Microsoft.Xna.Framework.GameComponent
public MouseInterface()

private Texture2D mousePointerTexture;
private SpriteBatch uiSpriteBatch;

private Vector2 mousePosition;

public Vector2 MousePosition
get { return mousePosition; }
set { mousePosition = value; }

private string mousePointer;

public string MousePointer
get { return mousePointer; }
set { mousePointer = value; }

private ButtonState middleButton;

public ButtonState MiddleButton
get { return middleButton; }
set { middleButton = value; }

private ButtonState leftButton;

public ButtonState LeftButton
get { return leftButton; }
set { leftButton = value; }

private ButtonState rightButton;

public ButtonState RightButton
get { return rightButton; }
set { rightButton = value; }
public override void Start()
// TODO: Add your start up code here

public override void Update()
// TODO: Add your update code here
MouseState ms = Mouse.GetState();
this.mousePosition = new Vector2(ms.X, ms.Y);

this.leftButton = ms.LeftButton;
this.rightButton = ms.RightButton;
this.middleButton = ms.MiddleButton;

public override void Draw()
// TODO: Add your drawing code here
// Draw the UI Components.
this.uiSpriteBatch.Draw(this.mousePointerTexture, this.mousePosition, Color.White);


protected virtual void LoadResources()
this.mousePointerTexture =
Texture2D.FromFile(((GraphicsComponent)Game.GameComponents[0]).GraphicsDevice, this.mousePointer);
this.uiSpriteBatch = new SpriteBatch(((GraphicsComponent)Game.GameComponents[0]).GraphicsDevice);


For those using it you should see how it works… Just drop it on assign the filename to the Mouse pointer in the component, and you are off.

Cross Post from Virtual Realm – Mykre’s Space

Lego Star Wars II Extra Content

With the release of Lego Star Wars II in the next few days (Should get mine tommorrow), I can across this post. It talks about Downloadable Content from the Marketplace, I wonder how lng it will take to be made availible.

“Xbox 360 gamers will be able to download Star Wars prequel characters from Xbox Live Marketplace to feature in their Lego Star Wars II game when it is released in September.”


Cross Post from Virtual Realm – Mykre’s Space

Gamefest 2006 Content available

For those of you like me that were un able to make it to Gamefest this year, the Gamefest contant is now availible on the Microsoft Site. When downloading it please note that some of the files are large (@500mb) so I would watch you download limits and such.

For more information on the content have a look at this post on Lets Kill Dave.

Here are some of the Streams that I am interested in is…

Gamefest 2006: Casual Games Track
  • Developing Games for Xbox Live Arcade
  • Developing Web-Based Games for MSN Games
  • Preparing Casual Games for Windows Vista
  • Developing Casual Games for MSN Messenger
  • Future Platforms and Opportunities for Casual Games

Gamefest 2006: Developer Tools: XNA and Visual Studio Track
  • Working Smarter and Building Faster with Visual C++ 2005
  • Managing Content Builds with XNA Build
  • An Introduction to Agile Development
  • Creating Games with the XNA Framework
  • A Closer Look at the XNA Framework Content Pipeline
  • Managing Content Builds with XNA Build

Cross Post from Virtual Realm – Mykre’s Space

Rotating a Simple Mesh using the MDX2 Sample Framework

I know that there is still a lot of buzz about the XNA Framework, but I was asked a small question on how to rotate a simple mesh with the Sample Framework that is included with the Managed DirectX System, so instead of just concentrating on XNA I thought I would post this.

The first step is to make sure that you have the empty project running from the latest SDK. Once this is done and working open the emptyproject.cs and add the following few lines of code directly after it.

// HUD Ui Control constants
private const int ToggleFullscreen = 1;
private const int ToggleReference = 3;
private const int ChangeDevice = 4;

Add this Code…

// Teapot Mesh
private Mesh teapotMesh = null;
private Material teapotMaterial;

Next you will need to ad the following few lines of code to the OnCreateDevice call, make sure you add the code to the end of the function.

// Create the teapot mesh
this.teapotMesh = Mesh.Teapot(e.Device);
this.teapotMaterial = new Material();
this.teapotMaterial.DiffuseColor = new ColorValue(1.0f, 1.0f, 1.0f, 1.0f);

To make sure that you can see the mesh we will need to add some light to the application. Add the following code block to the end of the OnResetDevice function.

// Setup Lights
e.Device.Lights[0].DiffuseColor = new ColorValue(1.0f, 1.0f, 1.0f, 1.0f);
e.Device.Lights[0].Direction = new Vector3(0, -1, 0);
e.Device.Lights[0].LightType = LightType.Directional;
e.Device.Lights[0].Enabled = true;

The last step is to actually render the Mesh to the Graphics Device, add the following code block to the OnFrameRender Call directly after the BeginSceneCalled=true is called.

device.Transform.View = camera.ViewMatrix;
device.Transform.Projection = camera.ProjectionMatrix;
device.Transform.World = Matrix.RotationX((float)appTime);
device.Material = this.teapotMaterial;

If every thing has been done correctly you should now see a rotating Teapot in the centre of the screen. Also as we are using the Sample Framework you should also be able to use the built in movement functions of the model viewer camera that the empty project uses to move the camera around the scene. To do this hold the right mouse button down and move the mouse… You can also use the wheel of the mouse to move the camera back and forth.

Hope this helps…

Cross Post from Virtual Realm – Mykre’s Space

Good Game: A program for Gamers by Gamers

Starting on the 19th of Sep there is going to be a new program on ABC2 (Digital Only) and also available online, a program for Gaming that is based in Australia. The good thing about this is that it is actually on at a good time and not on at Midnight.

"Good Game will be jam-packed with the latest gaming news and events, top gaming tips, reviews, techniques to pimp and boost your machine, and interviews with game developers and the people behind the scenes.

Hosted by Junglist and Kapowski, Good Game is filmed in the Den of Gaming (DOG); a gamers' paradise fitted out with just about every gaming device ever invented. Junglist and Kapowski are supported each week by Dr Daneel, Good Game's technical wizard, and P_Nutz, the computer-hacking ape.

If you miss Good Game on ABC2, you'll find the show online as video on demand here at

Good Game is dedicated to giving gamers an intelligent and entertaining analysis of the game scene in Australia and around the world.

GOOD GAME Every Tuesday from 19 September at 8.30pm on ABC2. Repeated on Wednesday at 10.30pm and Friday at 1am

ABC2 is the ABC's digital-only, free-to-air channel."

Cross Post from Virtual Realm – Mykre’s Space