SFML community forums

Help => Window => Topic started by: pdinklag on September 14, 2012, 07:56:03 pm

Title: sf::Event::SizeEvent does not use sf::Vector2u
Post by: pdinklag on September 14, 2012, 07:56:03 pm
While window sizes are now stored in a sf::Vector2u (http://sfml-dev.org/documentation/2.0/classsf_1_1Window.php#ad2b55a731ba1680fe67292991ef1610e) struct, the sf::Event::SizeEvent (http://sfml-dev.org/documentation/2.0/structsf_1_1Event_1_1SizeEvent.php) struct still uses a pair of integers for width and height. I believe for the sake of consistency, this should be changed.
Title: Re: sf::Event::SizeEvent does not use sf::Vector2i
Post by: Nexus on September 14, 2012, 07:58:08 pm
I have already proposed that, but sf::Vector2u can't be used for technical reasons. In C++98, unions require their members to be POD types, which is true for int, but not for sf::Vector2u.
Title: Re: sf::Event::SizeEvent does not use sf::Vector2u
Post by: pdinklag on September 15, 2012, 10:24:48 am
Oh right, the event thing is a union. I'm not used to these...
However, I guess in that case it's not a problem if I make it a Vector2i in JSFML then (not unsigned, there is no unsigned in Java ;) ).