Virtu/Library/Xna/GameBase.cs
Sean Fausett 8382195feb Initial sound emulation for WPF and XNA+Windows platforms via COM interop to DirectSound.
Added rudimentary UI to Silverlight and WPF platforms to enable disk selection at runtime.

--HG--
extra : convert_revision : svn%3Affd33b8c-2492-42e0-bdc5-587b920b7d6d/trunk%4024459
2009-07-26 23:22:00 +00:00

40 lines
1.2 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
namespace Jellyfish.Library
{
public class GameBase : Game
{
public GameBase(string name)
{
Name = name;
GraphicsDeviceManager = new GraphicsDeviceManager(this);
GraphicsDeviceService = (IGraphicsDeviceService)Services.GetService(typeof(IGraphicsDeviceService));
Components.Add(new GamerServicesComponent(this));
Content.RootDirectory = "Content";
if (!string.IsNullOrEmpty(Name))
{
Window.Title = Name;
}
}
protected override void Update(GameTime gameTime)
{
GamePadState gamePadState = GamePad.GetState(PlayerIndex.One);
if (gamePadState.Buttons.Back == ButtonState.Pressed)
{
Exit();
}
base.Update(gameTime);
}
public string Name { get; private set; }
public GraphicsDeviceManager GraphicsDeviceManager { get; private set; }
public IGraphicsDeviceService GraphicsDeviceService { get; private set; }
}
}