Created
December 5, 2015 21:27
-
-
Save donwilson/8bdbff5d4640c08d4f9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <iostream> | |
#include <stdlib.h> | |
int main(int argc, char **argv) { | |
sf::RenderWindow window(sf::VideoMode(800, 600), "test"); | |
sf::CircleShape circle(100.f); | |
circle.setFillColor(sf::Color::Green); | |
while(window.isOpen()) { | |
sf::Event event; | |
while(window.pollEvent(event)) { | |
switch(event.type) { | |
case sf::Event::Closed: | |
window.close(); | |
break; | |
case sf::Event::KeyPressed: | |
switch(event.key.code) { | |
case sf::Keyboard::Escape: | |
window.close(); | |
break; | |
} | |
break; | |
} | |
} | |
circle.move(1, 1); | |
window.clear(); | |
window.draw(circle); | |
window.display(); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment