SFML community forums

General => Feature requests => Topic started by: l0calh05t on July 23, 2008, 08:31:00 am

Title: Iconified event or window state
Post by: l0calh05t on July 23, 2008, 08:31:00 am
I already asked in an older thread of mine (other topic), but would it be possible to add iconified/uniconfied events, or an IsIconified() function? I'm fairly sure that type of event exist for all supported systems...
Title: Iconified event or window state
Post by: Laurent on July 23, 2008, 08:44:20 am
For what purpose ?
Title: Iconified event or window state
Post by: l0calh05t on July 23, 2008, 10:13:08 am
automatically pausing the game when it is iconified, for example. no need to waste cpu cycles while the game isn't being played.
Title: Iconified event or window state
Post by: Laurent on July 23, 2008, 10:58:34 am
Why not doing this with focus events ? You may want to pause your game if the window loses the focus, even if it hasn't been iconified. And when the window is iconified but still has focus, you won't care about CPU usage until you actually give focus to another window.
Title: Iconified event or window state
Post by: l0calh05t on July 23, 2008, 12:27:24 pm
but if you stop rendering in a visible (only out of focus) window, the contents get overwritten (at least in windows) and that looks pretty ugly... so if only focus information is available, I'll still have to refresh the image when paused. even if the window is iconified and it doesn't matter...

EDIT:
if it helps, the X11 events should be MapNotify/UnmapNotify and the Win32 event WM_ACTIVATE,  couldn't find anything for OSX, but I'm sure there is such an event.
Title: Iconified event or window state
Post by: Laurent on July 25, 2008, 08:51:32 am
Ok I see, should be easy to add ;)
Title: Iconified event or window state
Post by: Daazku on July 25, 2008, 05:47:37 pm
This is so nice when user take the time to search what Laurent need to do to implement something they want! Nive job l0calh05t.
Title: Iconified event or window state
Post by: l0calh05t on July 25, 2008, 06:53:30 pm
Quote from: "Daazku"
This is so nice when user take the time to search what Laurent need to do to implement something they want! Nive job l0calh05t.


If Laurent didn't do it, I would have to implement it myself. So why not help him do it, so that others can profit as well?
Title: Iconified event or window state
Post by: Daazku on July 25, 2008, 08:06:12 pm
Some people don't think like that...