testbed: prepare input system
This commit is contained in:
22
testbed/system/input_system.cpp
Normal file
22
testbed/system/input_system.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include <application/context.h>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include <system/input_system.h>
|
||||
|
||||
namespace testbed {
|
||||
|
||||
void input_system(entt::registry ®istry, const SDL_Event &event, bool &quit) {
|
||||
switch(event.type) {
|
||||
case SDL_EVENT_QUIT:
|
||||
quit = true;
|
||||
break;
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
switch(event.key.key) {
|
||||
case SDLK_ESCAPE:
|
||||
quit = true;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace testbed
|
||||
Reference in New Issue
Block a user