Key debugging added

This commit is contained in:
Michael Chen 2018-01-07 14:45:07 +01:00
parent 1d91b0aedb
commit 1eb3804673

10
main.c
View File

@ -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");