#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 { /// /// This is the main type for your game /// 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); } /// /// 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. /// 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(); /// /// Load your graphics content. If loadAllContent is true, you should /// load content from both ResourceManagementMode pools. Otherwise, just /// load ResourceManagementMode.Manual content. /// /// Which type of content to load. protected override void LoadGraphicsContent(bool loadAllContent) { if (loadAllContent) { // TODO: Load any ResourceManagementMode.Automatic content } // TODO: Load any ResourceManagementMode.Manual content } /// /// 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. /// /// Which type of content to unload. protected override void UnloadGraphicsContent(bool unloadAllContent) { if (unloadAllContent == true) { content.Unload(); } } #region UPDATE /// /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input and playing audio. /// /// Provides a snapshot of timing values. 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 /// /// This is called when the game should draw itself. /// /// Provides a snapshot of timing values. protected override void Draw(XNA.GameTime gameTime) { graphics.GraphicsDevice.Clear(XNAg.Color.CornflowerBlue); base.Draw(gameTime); } #endregion } }