Added camera operations and better input handling

This commit is contained in:
Julian Nießner
2018-05-07 16:58:15 +02:00
parent 1039a0fdb6
commit 51eff2d983
9 changed files with 118 additions and 27 deletions

View File

@@ -10,18 +10,21 @@ InputHandler::~InputHandler() {
//Free all Commands
}
void InputHandler::handleInput(SDL_Event *event) {
Command* InputHandler::handleInput(SDL_Event *event) {
if(event == NULL) {
return;
return NULL;
}
switch (event->type) {
case SDL_KEYDOWN:
std::cout << "The Key " << SDL_GetKeyName(event->key.keysym.sym) << " has been pressed!" << std::endl;
return NULL;
break;
case SDL_KEYUP:
std::cout << "The Key " << SDL_GetKeyName(event->key.keysym.sym) << " has been released!" << std::endl;
return NULL;
break;
default: break;
default:
return NULL;
break;
}
}