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.


Messages - bobSavGa

Pages: [1]
1
Graphics / Re: multiple setPosition on same object help
« on: December 19, 2014, 05:30:14 pm »
what a dope :(
thanks  vastly

2
Graphics / multiple setPosition on same object help
« on: December 19, 2014, 04:53:53 pm »
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;
}

Pages: [1]
anything