Created
May 10, 2018 21:24
-
-
Save eXpl0it3r/99547fc2e005b711673abea814716872 to your computer and use it in GitHub Desktop.
Example Input Test
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> | |
int main() | |
{ | |
sf::RenderWindow window(sf::VideoMode(1280, 720), "Minimal, complete and verifiable example"); | |
window.setFramerateLimit(60); | |
while (window.isOpen()) | |
{ | |
sf::Event event; | |
while (window.pollEvent(event)) | |
{ | |
if (event.type == sf::Event::Closed) | |
window.close(); | |
else if (event.type == sf::Event::KeyPressed) | |
std::cout << "KeyPressed: " << event.key.code << "\n"; | |
else if (event.type == sf::Event::KeyReleased) | |
std::cout << "KeyReleased: " << event.key.code << "\n"; | |
} | |
window.clear(); | |
window.display(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment