Skip to content

Instantly share code, notes, and snippets.

@donwilson
Created December 5, 2015 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donwilson/8bdbff5d4640c08d4f9f to your computer and use it in GitHub Desktop.
Save donwilson/8bdbff5d4640c08d4f9f to your computer and use it in GitHub Desktop.
#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