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

Author Topic: Closing windows at memorystate destruction  (Read 730 times)

0 Members and 1 Guest are viewing this topic.

linc186

  • Newbie
  • *
  • Posts: 4
    • View Profile
Closing windows at memorystate destruction
« on: May 23, 2013, 06:11:32 am »
Hello!

I'm writing a tile editor that opens with a window where the user chooses new project, quit, or load project. When the user hits new, it loads the new state into memory and opens the actual editor. I put window.close(); into the destructor so when a new state is loaded, the old window closes. Instead, the new window opens and works fine, while the old is still present, but it's unresponsive as it's been taken out of memory. How do I get this window to disappear completely? Thank you for your help.

(I'm using SFML 2.0, the 64-Bit GCC compiler, Archlinux if that's helpful at all)
« Last Edit: May 23, 2013, 06:24:12 am by linc186 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
AW: Closing windows at memorystate destruction
« Reply #1 on: May 23, 2013, 08:51:33 am »
window.close() should let it diaappear, unless your window manager acts up.
You could also let the window get out of scope.

The question I'd have to adk myself would be: Fo I really need multiple windows? Can't I just switch state internally and reuse the same window?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/