Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int width = 800;
- int height = 600;
- int x = width/2;
- int y = height/2;
- int main()
- {
- sf::RenderWindow window(sf::VideoMode(width, height), "Generic name for a window");
- window.setFramerateLimit(60);
- sf::CircleShape circle(30.f);
- circle.setFillColor(sf::Color::Black);
- //circle.setOutlineThickness(15.f);
- //circle.setOutlineColor(sf::Color::Green);
- sf::Event event;
- while (window.isOpen())
- {
- window.clear(sf::Color::White);
- while (window.pollEvent(event))
- {
- if ((event.type == sf::Event::Closed) || (event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape))
- window.close();
- if(event.type == sf::Event::MouseMoved)
- {
- x = event.mouseMove.x;
- y = event.mouseMove.y;
- circle.setPosition(x, y);
- }
- }
- window.draw(circle);
- window.display();
- }
- int pause; cin >> pause; //Pause the program
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement