aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-09-07 11:27:05 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-09-07 11:27:05 -0400
commit47091d3e2d7a2460c2111725b7c344d2df9eb699 (patch)
tree3810ec9943a6920b1680f49a8f28e23a4059998d /src/main.cpp
parent9af4fbcd7bf9a922152c966aa92daaf7a5e75410 (diff)
esc to quit
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp15
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