As I understand the event tutorial, the following code should not move the shape when the mouse is moved or a key pressed, but the shape does move?
?
#include <SFML/Graphics.hpp>
int main()
{
int x = 50, y = 50;
sf::RenderWindow window(sf::VideoMode(800, 600), "Input data test" );
sf::CircleShape shape(20);
shape.setFillColor(sf::Color::Color(255,0,0));
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
window.clear(sf::Color(128,128,128));
shape.setPosition(x, y);
window.draw(shape);
window.display();
if(x < 750) x = x + 25;
else
{
x = 50;
y = y + 25;
}
}
}
return EXIT_SUCCESS;
}