1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#include <SFML/graphics.hpp>
int main(void)
{
using std::cout;
using std::endl;
sf::RenderWindow window;
window.create( sf::VideoMode( x, y ), "nom", sf::Styles::Default );
while( window.isOpen())
{
sf::Event event;
while( window.pollEvent( event ) )
{
if( event.type == event.Closed )
window.close();
if( event.type == event.KeyPressed ) // switch
{
if( sf::Keyboard::isKeyPressed( sf::Keyboard::Up ) )
/// afficher quelque chose
else if( sf::Keyboard::isKeyPressed( sf::Keyboard::Down ) )
/// afficher autre chose
}
}
window.clear( sf::Color::White );
window.display();
}
return 0;
} |
Partager