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

Author Topic: Resize event behavior  (Read 2888 times)

0 Members and 2 Guests are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Resize event behavior
« on: June 28, 2011, 06:52:18 pm »
Hello, I work with Visual Studio 2010 and SFML 2 revision 175cdd... I have the following code:
Code: [Select]
#include <SFML/Window.hpp>
#include <iostream>

int main()
{
sf::Window window(sf::VideoMode(400, 300), "Resize test");

for (;;)
{
sf::Event event;
while (window.PollEvent(event))
{
if (event.Type == sf::Event::Resized)
std::cout << "Resize: w=" << event.Size.Width << ", h=" << event.Size.Height << std::endl;

else if (event.Type == sf::Event::KeyPressed)
return 0;
}

window.Display();
}
}

Two issues:

  • When I minimize the window and maximize it again, a Resize event is triggered.
  • When I draw the edges to resize the window manually, many Resize events are generated, although one would be enough.
Is this behavior intended? If so, why?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

danman

  • Hero Member
  • *****
  • Posts: 1121
    • View Profile
    • Email
Resize event behavior
« Reply #1 on: June 28, 2011, 08:25:35 pm »
It depends of the system ;) . For exemple my gnome3 only trigger one resize event when I resize a window
Pointilleur professionnel

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Resize event behavior
« Reply #2 on: July 02, 2011, 10:42:05 pm »
Quote from: "danman"
It depends of the system ;)
One more reason to fix it :P
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Resize event behavior
« Reply #3 on: July 02, 2011, 10:45:06 pm »
Yep. Don't be afraid to add an issue on the task tracker ;)
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Resize event behavior
« Reply #4 on: July 02, 2011, 11:04:40 pm »
Done: https://github.com/SFML/SFML/issues/68

I never know if I just overlook something and there is a well-thought intention behind it, so I'm rather conservative with creating new issues... But maybe I shouldn't, as you can easily close them ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything