testbed: prepare input system

This commit is contained in:
skypjack
2025-04-28 17:01:53 +02:00
parent b0afed4bd0
commit f505050391
5 changed files with 38 additions and 13 deletions

View 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 &registry, 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