Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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