1
DotNet / Re: How to switch between window/fullscreen mode at runtime with SFML.NET?
« on: September 30, 2015, 11:26:00 pm »
I don't know if this help you. It's part of my code.
public static void ToggleFullscren(Game Game)
{
Game.Fullscreen = !Game.Fullscreen;
Game.RenderWindow.Close();
Game.RenderWindow = new RenderWindow(new VideoMode(960, 720), "My Game", (Game.Fullscreen ? Styles.Fullscreen : Styles.Close));
Game.RenderWindow.Position = new Vector2i(200, 0);
Game.RenderWindow.SetFramerateLimit(60);
Game.RenderWindow.SetVerticalSyncEnabled(true);
Game.StackStateManager.PeekState().addEvents();
Game.RenderWindow.Capture();
Game.RenderWindow.Display();
}
public static void ToggleFullscren(Game Game)
{
Game.Fullscreen = !Game.Fullscreen;
Game.RenderWindow.Close();
Game.RenderWindow = new RenderWindow(new VideoMode(960, 720), "My Game", (Game.Fullscreen ? Styles.Fullscreen : Styles.Close));
Game.RenderWindow.Position = new Vector2i(200, 0);
Game.RenderWindow.SetFramerateLimit(60);
Game.RenderWindow.SetVerticalSyncEnabled(true);
Game.StackStateManager.PeekState().addEvents();
Game.RenderWindow.Capture();
Game.RenderWindow.Display();
}