#region Using Statements
using SYS=System;
using SYSc=System.Collections.Generic;
using XNA=Microsoft.Xna.Framework;
using XNAa=Microsoft.Xna.Framework.Audio;
using XNAc=Microsoft.Xna.Framework.Content;
using XNAg=Microsoft.Xna.Framework.Graphics;
using XNAi=Microsoft.Xna.Framework.Input;
using XNAs=Microsoft.Xna.Framework.Storage;
#endregion
namespace Vektor
{
/// <summary>
/// This is the main type for your game
/// </summary>
public class GameEngine : Microsoft.Xna.Framework.Game
{
public XNA.GraphicsDeviceManager graphics;
public XNAc.ContentManager content;
public GameEngine()
{
graphics = new XNA.GraphicsDeviceManager(this);
content = new XNAc.ContentManager(Services);
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
base.Initialize();
}
XNAg.GraphicsAdapter Adapter = XNAg.GraphicsAdapter.DefaultAdapter;
XNAg.DeviceType Device = new XNAg.DeviceType();
SYS.IntPtr Ptr = SYS.IntPtr.Zero;
XNAg.CreateOptions Opt = new XNAg.CreateOptions();
XNAg.PresentationParameters PresPar = new XNAg.PresentationParameters();
XNAg.GraphicsDevice Graphics = new XNAg.GraphicsDevice(Adapter, Device, Ptr, Opt, PresPar);
XNAg.Texture2D TempImage = XNAg.Texture2D.FromFile(Graphics, "What.png");
XNAg.SpriteBatch drawer = new XNAg.SpriteBatch(Graphics);
drawer.Begin();
/// <summary>
/// Load your graphics content. If loadAllContent is true, you should
/// load content from both ResourceManagementMode pools. Otherwise, just
/// load ResourceManagementMode.Manual content.
/// </summary>
/// <param name="loadAllContent">Which type of content to load.</param>
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
// TODO: Load any ResourceManagementMode.Automatic content
}
// TODO: Load any ResourceManagementMode.Manual content
}
/// <summary>
/// Unload your graphics content. If unloadAllContent is true, you should
/// unload content from both ResourceManagementMode pools. Otherwise, just
/// unload ResourceManagementMode.Manual content. Manual content will get
/// Disposed by the GraphicsDevice during a Reset.
/// </summary>
/// <param name="unloadAllContent">Which type of content to unload.</param>
protected override void UnloadGraphicsContent(bool unloadAllContent)
{
if (unloadAllContent == true)
{
content.Unload();
}
}
#region UPDATE
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(XNA.GameTime gameTime)
{
// Allows the default game to exit on Xbox 360 and Windows
if (XNAi.GamePad.GetState(XNA.PlayerIndex.One).Buttons.Back == XNAi.ButtonState.Pressed)
this.Exit();
// TODO: Add your update logic here
base.Update(gameTime);
}
#endregion
#region Draw
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(XNA.GameTime gameTime)
{
graphics.GraphicsDevice.Clear(XNAg.Color.CornflowerBlue);
base.Draw(gameTime);
}
#endregion
}
}