Glatzemann 0e1d271195 refactored AddInSystem (testing needed)
implemented feature #469 (Default AddIn override)
2011-12-06 09:11:26 +00:00

67 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using ANX.Framework;
using ANX.Framework.Content;
using ANX.Framework.Graphics;
using ANX.Framework.Input;
using ANX.Framework.Input.MotionSensing;
namespace Kinect
{
public class Game1 : ANX.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
MotionSensingDeviceState kinectState;
public Game1()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "SampleContent";
}
protected override void Initialize()
{
MotionSensingDevice.GraphicsDevice = GraphicsDevice;
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
// TODO: Verwenden Sie this.Content, um Ihren Spiel-Inhalt hier zu laden
}
protected override void Update(GameTime gameTime)
{
//TODO: reactivate
//if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
// this.Exit();
kinectState = MotionSensingDevice.GetState();
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.Black);
if (kinectState.Depth != null)
{
spriteBatch.Begin();
spriteBatch.Draw(kinectState.RGB, Vector2.Zero, Color.White);
spriteBatch.End();
}
base.Draw(gameTime);
}
}
}