diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index df9d069..8b3036e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,8 +46,21 @@ int main(int argc,char **argv){ glClear(GL_COLOR_BUFFER_BIT); SDL_GL_SwapWindow(window); while(SDL_PollEvent(&e)){ - if(e.type==SDL_QUIT) + switch(e.type){ + case SDL_QUIT: gameRunning=false; + break; + case SDL_KEYDOWN: + switch(e.key.keysym.sym){ + case 27: + gameRunning=false; + break; + default: + break; + } + default: + break; + } } } //closes the window and frees resources |