diff --git a/main.c b/main.c index 0f90f0e..98f20af 100644 --- a/main.c +++ b/main.c @@ -14,7 +14,7 @@ void INITIALIZE(); void QUIT(); void GAMELOOP(); void mousePress(SDL_MouseButtonEvent b); -void mousePress(); +void keyPress(SDL_KeyboardEvent b); const int width = 1600; // TODO: Fullscreen const int height = 900; @@ -37,7 +37,7 @@ int main(int argc, char * args[]){ break; case SDL_KEYDOWN: if (event.key.keysym.scancode == SDL_SCANCODE_ESCAPE) running = false; - else keyPress(); + else keyPress(event.key); break; case SDL_MOUSEBUTTONDOWN: mousePress(event.button); @@ -63,8 +63,8 @@ void mousePress(SDL_MouseButtonEvent b){ // Debug prop } } -void keyPress(){ // Debug prop - +void keyPress(SDL_KeyboardEvent b){ // Debug prop + printf("Key pressed: ID is %d\n", b.keysym.scancode); } void DrawFrame(){ @@ -89,7 +89,7 @@ void INITIALIZE() { void QUIT(){ printf("De-initializing started...\n"); free(keystate); - //IMG_Quit(); + // IMG_Quit(); printf("Quitting SDL_IMG finished!\n"); SDL_DestroyRenderer(renderer); printf("De-initializing renderer finished!\n");