public Configuration(Game game)
: base(game)
{
graphics = new GraphicsDeviceManager(game);
Game_Library.Configuration config = game.Content.Load<Game_Library.Configuration>("Interface/Configuration");
Width = config.Width;
Height = config.Height;
Fullscreen = config.Fullscreen;
if (Fullscreen == true)
{
graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width;
graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height;
graphics.ApplyChanges();
if (graphics.IsFullScreen == false)
graphics.ToggleFullScreen();
}
else
{
graphics.PreferredBackBufferHeight = Height;
graphics.PreferredBackBufferWidth = Width;
graphics.ApplyChanges();
if (graphics.IsFullScreen == true)
graphics.ToggleFullScreen();
}
game.Window.ClientSizeChanged += new EventHandler<EventArgs>(OnResize);
}