Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dabbertorres/input
A C++11 input manager for SFML.
https://github.com/dabbertorres/input
Last synced: about 2 months ago
JSON representation
A C++11 input manager for SFML.
- Host: GitHub
- URL: https://github.com/dabbertorres/input
- Owner: dabbertorres
- License: mit
- Created: 2014-03-28T03:41:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-09-27T06:15:58.000Z (over 8 years ago)
- Last Synced: 2023-08-21T18:13:15.896Z (over 1 year ago)
- Language: C++
- Size: 14.6 KB
- Stars: 12
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SwiftInputManager
=================A C++11 input manager for SFML.
Pretty simple to use, and header-only, so nice and easy to include in a project.
#Example:
```c++
#include
#include#include "InputManager.hpp"
int main(int argc, char** argv)
{
sf::Window window(sf::VideoMode(800, 600, 32), "SFML");
swift::InputManager keyboard;
swift::InputManager mouse;
keyboard.add(sf::Keyboard::Escape, [&window]()
{
window.close();
});
mouse.add(sf::Mouse::Right, [&window]()
{
window.close();
});
while(window.isOpen())
{
sf::Event event;while(window.pollEvent(event))
{
keyboard(event);
mouse(event);
switch(event.type)
{
case sf::Event::Closed:
window.close();
break;
default:
break;
}
}window.clear();
window.display();
}
return 0;
}
```#License
MIT License