Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Graphics.hpp>
- int main()
- {
- // create the window
- sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
- // run the program as long as the window is open
- while (window.isOpen())
- {
- // check all the window's events that were triggered since the last iteration of the loop
- sf::Event event;
- while (window.pollEvent(event))
- {
- // "close requested" event: we close the window
- if (event.type == sf::Event::Closed)
- window.close();
- }
- // clear the window with black color
- window.clear(sf::Color::Black);
- sf::CircleShape shape(20,3);
- shape.setFillColor(sf::Color(255,210,20));
- sf::CircleShape choina1(100,3);
- choina1.setFillColor(sf::Color(30,85,0));
- sf::CircleShape choina2(150,3);
- choina2.setFillColor(sf::Color(10,70,0));
- sf::CircleShape choina3(200,3);
- choina3.setFillColor(sf::Color(0,50,0));
- sf::CircleShape pien(40,4);
- pien.setFillColor(sf::Color(41,16,0));
- sf::CircleShape babka(25,100);
- babka.setFillColor(sf::Color(255,255,255));
- sf::CircleShape prezent1(25,4);
- prezent1.setFillColor(sf::Color(81,16,98));
- sf::CircleShape prezent2(30,4);
- prezent2.setFillColor(sf::Color(100,16,160));
- sf::CircleShape prezent3(35,4);
- prezent3.setFillColor(sf::Color(140,10,190));
- sf::RectangleShape wstazka(sf::Vector2f(49, 5));
- wstazka.setFillColor(sf::Color(200,140,10));
- sf::RectangleShape wstazka2(sf::Vector2f(34, 5));
- wstazka2.setFillColor(sf::Color(0,50,150));
- sf::RectangleShape wstazka3(sf::Vector2f(34, 5));
- wstazka3.setFillColor(sf::Color(200,140,10));
- sf::RectangleShape wstazka31(sf::Vector2f(34, 5));
- wstazka31.setFillColor(sf::Color(200,140,10));
- // draw everything here...
- shape.setPosition(380,50);
- shape.setRotation(0);
- window.draw(shape);
- shape.setPosition(420,90);
- shape.setRotation(180);
- window.draw(shape);
- choina3.setPosition(200,200);
- window.draw(choina3);
- choina2.setPosition(250,140);
- window.draw(choina2);
- choina1.setPosition(300,80);
- window.draw(choina1);
- pien.setPosition(400,472);
- pien.setRotation(45);
- window.draw(pien);
- babka.setPosition(250,465);
- window.draw(babka);
- babka.setPosition(450,400);
- window.draw(babka);
- prezent1.setPosition(525,500);
- prezent1.setRotation(45);
- window.draw(prezent1);
- prezent2.setPosition(460,490);
- prezent2.setRotation(45);
- window.draw(prezent2);
- prezent2.setPosition(480,490);
- prezent2.setRotation(45);
- window.draw(prezent2);
- prezent3.setPosition(320,480);
- prezent3.setRotation(45);
- window.draw(prezent3);
- wstazka.setPosition(322,505);
- wstazka.setRotation(90);
- window.draw(wstazka);
- wstazka.setPosition(345,530);
- wstazka.setRotation(180);
- window.draw(wstazka);
- wstazka2.setPosition(526,519);
- wstazka2.setRotation(90);
- window.draw(wstazka2);
- wstazka2.setPosition(542,537);
- wstazka2.setRotation(180);
- window.draw(wstazka2);
- wstazka3.setPosition(480,519);
- wstazka3.setRotation(90);
- window.draw(wstazka3);
- wstazka31.setPosition(480,537);
- wstazka31.setRotation(180);
- window.draw(wstazka31);
- // end the current frame
- window.display();
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment