Hi guys. I have a little problem. It happens when i`m moving picture in the window and a mouse cursor (in that window) at the same time.. Picture starts to move rather quickly than when coursor don`t move or moving in
not my window.. It`s normal?
Maybe it depends ..
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(380, 390), "Happines!");
sf::RectangleShape s;
s.setSize(sf::Vector2f(10, 50));
s.setPosition(10, 50);
s.setFillColor(sf::Color::Red);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)){
s.move(1, 0);
}
}
window.clear(sf::Color::White);
window.draw(s);
window.display();
}
return 0;
}
Video :
http://www.youtube.com/watch?v=3QqN92AKbM4&feature=youtu.be