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

Author Topic: [SFML2] bug sf::Event::Resized and window.setSize()  (Read 3179 times)

0 Members and 1 Guest are viewing this topic.

LudoNoob

  • Newbie
  • *
  • Posts: 7
    • View Profile
[SFML2] bug sf::Event::Resized and window.setSize()
« on: May 20, 2011, 06:34:18 pm »
i just want keep the ratio of my window

Code: [Select]
if (event.Type == sf::Event::Resized)
{
x = window.GetWidth();
y = window.GetHeight();
if(window.GetHeight() >= window.GetWidth()) window.SetSize(x, (static_cast<unsigned int>(x*0.69)));
else window.SetSize(static_cast<unsigned int>(y*1.45), y);
}


it s the only event i have in my boucle (exept sf::Event::Closed), and when i try to resize my window, it dont work on the right border, it move my window on the left border (and keep the size), and it work about 1 time on 10 with the top and bottom border

very strange ...

i use this code in the boucle for event :
Quote
sf::Event event;
         while (window.PollEvent(event))
         {



is it a sfml2 bug ? or it s the same with 1.6 ?
or perhaps my function is a garbage -_-
 thank you