Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML.Net Window.Close() clearing events  (Read 2311 times)

0 Members and 1 Guest are viewing this topic.

gusg21

  • Newbie
  • *
  • Posts: 1
  • what does this do
    • View Profile
    • GitHub Account
SFML.Net Window.Close() clearing events
« 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

!@#$%^&*()

 

anything