/* * author: Patrick-Christopher Mattulat * e-mail: webmaster@lynarstudios.com */ #include #include #include using ls::atlantis::interfaces::IKeyboard; using ls::atlantis::window::SdlKeyEventManager; using ls::atlantis::window::SdlWindowApiEventManager; using ::std::make_shared; using ::std::shared_ptr; SdlWindowApiEventManager::SdlWindowApiEventManager() { this->sdlEvent = make_shared(); } SdlWindowApiEventManager::~SdlWindowApiEventManager() = default; void SdlWindowApiEventManager::manage(const shared_ptr &_keyboard) { while (SDL_PollEvent(this->sdlEvent.get())) { switch (this->sdlEvent->type) { case SDL_EVENT_KEY_DOWN: { SdlKeyEventManager::manageKeyDownEvent(_keyboard, this->sdlEvent); } break; case SDL_EVENT_KEY_UP: { SdlKeyEventManager::manageKeyUpEvent(_keyboard, this->sdlEvent); } break; default: { // other use cases not supported, yet } } } }