C++/SFML 2.1 CircleApp


SUBMITTED BY: PlumpDolphin

DATE: July 14, 2016, 10:27 p.m.

FORMAT: C++

SIZE: 656 Bytes

HITS: 720

  1. //This is a c++/sfml 2.1 program that draws a circle.
  2. #include <iostream>
  3. #include <SFML/Graphics.hpp>
  4. using namespace std;
  5. int main()
  6. {
  7. sf::RenderWindow circleApp(sf::VideoMode(128, 128), "Circle");
  8. sf::Event appEvent;
  9. sf::CircleShape circleObj(64.f);
  10. circleObj.setFillColor(sf::Color::Red);
  11. while(circleApp.isOpen())
  12. {
  13. while(circleApp.pollEvent(appEvent))
  14. {
  15. if(appEvent.type == sf::Event::Closed)
  16. circleApp.close();
  17. }
  18. circleApp.clear();
  19. circleApp.draw(circleObj);
  20. circleApp.display();
  21. }
  22. return (0);
  23. }

comments powered by Disqus