SFML community forums

Help => Window => Topic started by: gusg21 on March 13, 2020, 02:52:28 am

Title: SFML.Net Window.Close() clearing events
Post by: gusg21 on March 13, 2020, 02:52:28 am
Hello,

I've been trying to get fullscreen toggling to work in SFML.Net, and here's my code for that:

public void ToggleFullscreen()
{
        WindowStyle ^= Styles.Fullscreen;
        IsFullscreen = !IsFullscreen;

        if (window != null && window.IsOpen)
        {
                window.Close ();
        }

        window = new RenderWindow ((IsFullscreen ? VideoMode.DesktopMode : WindowMode), WindowTitle, WindowStyle);
}

But when I close() the window, all my events seem to get cleared. How do I fix this?

Thanks,
Gus