diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-07 11:27:05 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-07 11:27:05 -0400 |
commit | 47091d3e2d7a2460c2111725b7c344d2df9eb699 (patch) | |
tree | 3810ec9943a6920b1680f49a8f28e23a4059998d /src | |
parent | 9af4fbcd7bf9a922152c966aa92daaf7a5e75410 (diff) |
esc to quit
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 |