sfml-tutorial/events.cpp
2012-03-04 22:38:43 -05:00

26 lines
503 B
C++
Executable File

#include <SFML/Window.hpp>
int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
if ( (Event.Type == sf::Event::KeyPressed)
&& (Event.Key.Code == sf::Key::Escape) )
App.Close();
}
App.Display();
}
return EXIT_SUCCESS;
}