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

Author Topic: Restart Window inside isOpen loop  (Read 3627 times)

0 Members and 1 Guest are viewing this topic.

schlepper_64bit

  • Newbie
  • *
  • Posts: 1
    • View Profile
Restart Window inside isOpen loop
« on: April 12, 2024, 04:59:56 pm »
Hello,
I was wondering if it's possible to close and reopen/restart a game window through an event poll inside its while(isOpen()) loop. Anything I attempt just results in closing the window, as that seems to make anything after it in accessible.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Restart Window inside isOpen loop
« Reply #1 on: April 12, 2024, 06:45:08 pm »
If you close and directly re-create the window, you won't just drop out of the loop, but by the time you hit the while condition again, it will already be reported as open again, so you won't leave the loop :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything