More tweaking and refactoring

This commit is contained in:
MitchellHansen
2017-09-23 12:46:26 -07:00
parent e0cb26a9d1
commit 0b42481020
9 changed files with 154 additions and 106 deletions

View File

@@ -44,6 +44,14 @@ public:
virtual void recieve_event(VrEventPublisher* publisher, std::unique_ptr<vr::Event>(event)) override {
if (event.get()->type == vr::Event::Closed) {
window_ref->close();
} else if (event.get()->type == vr::Event::KeyPressed) {
vr::KeyPressed *key_event = static_cast<vr::KeyPressed*>(event.get());
if (key_event->code == sf::Keyboard::Escape) {
window_ref->close();
}
}
};