I'm having trouble with the syntax for toggling fullscreen and changing resolutions.
It seems in the C implementation of SFML, you would call: App.Create(...), but I can't find the equivalent call in the Dotnet implementation.
Here's my attempt at it, though all it does is create a separate empty fullscreen window that doesn't receive any input. Any help would be appreciated!
using System;
using SFML;
using SFML.Window;
using SFML.Graphics;
namespace WindowTest
{
public class Game1
{
static void Main()
{
RenderWindow App = new RenderWindow(new VideoMode(640, 480, 32), "Window test");
App.Closed += new EventHandler(OnClosed);
App.KeyPressed += new EventHandler<SFML.Window.KeyEventArgs>(OnKeyPressed);
while (App.IsOpened())
{
App.DispatchEvents();
App.Clear(Color.Cyan);
App.Display();
}
}
static void OnClosed(object sender, EventArgs e)
{
RenderWindow window = (RenderWindow)sender;
window.Close();
}
static void OnKeyPressed(object sender, SFML.Window.KeyEventArgs e)
{
RenderWindow window = (RenderWindow)sender;
if (e.Code == KeyCode.Return)
{
//go to fullscreen.
window = new RenderWindow(new VideoMode(1024, 768, 32),
"New Title", Styles.Fullscreen);
}
if (e.Code == KeyCode.Escape)
{
window.Close();
}
}
}
}