SFML community forums

Help => General => Topic started by: linc186 on May 23, 2013, 06:11:32 am

Title: Closing windows at memorystate destruction
Post by: linc186 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)
Title: AW: Closing windows at memorystate destruction
Post by: eXpl0it3r 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?