Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Graphics.hpp>
- using namespace std;
- int main()
- {
- // create the window
- sf::RenderWindow window(sf::VideoMode(800, 600), "Choinka");
- //sf::CircleShape shape(20.f, 3);
- //shape.setFillColor(sf::Color(100, 250, 50));
- sf::CircleShape shape(20,4);
- shape.setFillColor(sf::Color(170, 170, 40));
- //sf::RectangleShape rectangle(sf::Vector2f(120, 50));???
- sf::RectangleShape line(sf::Vector2f(150, 5));
- line.rotate(0);
- // define a triangle
- sf::CircleShape triangle(80, 3);
- // define a square
- sf::CircleShape square(80, 4);
- // define an octagon
- sf::CircleShape octagon(80, 8);
- // 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);
- // draw everything here...
- shape.setOutlineThickness(10);
- shape.setOutlineColor(sf::Color::Green);
- shape.setPosition(370, 270);
- //rectangle.setSize(sf::Vector2f(100, 100));???
- window.draw(shape);
- // window.draw(...);
- shape.setPosition(370, 300);
- shape.setFillColor(sf::Color::Green);
- window.draw(shape);
- // end the current frame
- window.display();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment