the code works perfectly, but flashes, with the clear commented out but shows a blank screen with clear.
help???
#include <SFML/Graphics.hpp>
int main(int argc, char *argv[]) {
sf::RenderWindow window(sf::VideoMode(600, 600), "SFML works!");
sf::CircleShape shape(10.f);
int x, stop, increment;
//stop must be bigger than start
//change 10 to the desired start value
x = 10;
//change 600 to the stopping point
stop = 600;
//change 20 to the table increment
increment = 20;
shape.setFillColor(sf::Color::Green);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
for (; x <= stop; x = x + increment) {
shape.setPosition(x, x);
window.draw(shape);
}
window.display();
}
return 0;
}