Last active
August 10, 2022 06:21
-
-
Save Kraballa/e928ea611b0727548416c325f55e841a to your computer and use it in GitHub Desktop.
main game class of a basic FNA project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Xna.Framework; | |
namespace YourNamespace | |
{ | |
internal class Controller : Game | |
{ | |
private static string Title = "Title"; | |
public const int WIDTH = 1280; | |
public const int HEIGHT = 720; | |
public static Controller Instance; | |
private Color ClearColor { get; set; } = Color.White; | |
private GraphicsDeviceManager Graphics; | |
public Controller() : base() | |
{ | |
Instance = this; | |
IsMouseVisible = true; | |
Graphics = new GraphicsDeviceManager(this); | |
IsFixedTimeStep = false; | |
Window.Title = Title; | |
Window.AllowUserResizing = false; | |
Graphics.PreferredBackBufferWidth = WIDTH; | |
Graphics.PreferredBackBufferHeight = HEIGHT; | |
Graphics.ApplyChanges(); | |
} | |
protected override void Draw(GameTime gameTime) | |
{ | |
base.Draw(gameTime); | |
GraphicsDevice.Clear(ClearColor); | |
//begin render | |
//... | |
//end render | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment