SFML community forums

Help => Window => Topic started by: Nexus on June 28, 2011, 06:52:18 pm

Title: Resize event behavior
Post by: Nexus 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:

Is this behavior intended? If so, why?
Title: Resize event behavior
Post by: danman 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
Title: Resize event behavior
Post by: Nexus on July 02, 2011, 10:42:05 pm
Quote from: "danman"
It depends of the system ;)
One more reason to fix it :P
Title: Resize event behavior
Post by: Laurent on July 02, 2011, 10:45:06 pm
Yep. Don't be afraid to add an issue on the task tracker ;)
Title: Resize event behavior
Post by: Nexus 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 ;)