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

Author Topic: Iconified event or window state  (Read 23907 times)

0 Members and 3 Guests are viewing this topic.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Iconified event or window state
« 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...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Iconified event or window state
« Reply #1 on: July 23, 2008, 08:44:20 am »
For what purpose ?
Laurent Gomila - SFML developer

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Iconified event or window state
« Reply #2 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Iconified event or window state
« Reply #3 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.
Laurent Gomila - SFML developer

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Iconified event or window state
« Reply #4 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Iconified event or window state
« Reply #5 on: July 25, 2008, 08:51:32 am »
Ok I see, should be easy to add ;)
Laurent Gomila - SFML developer

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Iconified event or window state
« Reply #6 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.
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Iconified event or window state
« Reply #7 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?

Daazku

  • Hero Member
  • *****
  • Posts: 896
    • View Profile
Iconified event or window state
« Reply #8 on: July 25, 2008, 08:06:12 pm »
Some people don't think like that...
Pensez à mettre le tag [Résolu] une fois la réponse à votre question trouvée.
Remember to add the tag [Solved] when you got an answer to your question.

 

anything