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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - LudoNoob

Pages: [1]
1
Window / [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

Pages: [1]