summaryrefslogtreecommitdiff
path: root/application.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application.cpp')
-rw-r--r--application.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/application.cpp b/application.cpp
index 072c7a8..371ef2f 100644
--- a/application.cpp
+++ b/application.cpp
@@ -135,6 +135,7 @@ Application::~Application() {
void Application::run() {
elapsed = 0;
+ paused = false;
font = new FTPixmapFont("VeraMono.ttf");
font->FaceSize(12);
@@ -153,16 +154,18 @@ void Application::run() {
shader->attach(shader2);
shader->link();
- unsigned int lasttick = SDL_GetTicks();
+ lasttick = SDL_GetTicks();
while(1) {
SDL_Event event;
- SDL_PollEvent(&event);
- if(event.type == SDL_QUIT) {
- break;
- } else if(event.type == SDL_KEYDOWN) {
- event_keypress(event.key.keysym.sym);
+ while(SDL_PollEvent(&event)) {
+ if(event.type == SDL_QUIT) {
+ break;
+ } else if(event.type == SDL_KEYDOWN) {
+ event_keypress(event.key.keysym.sym);
+ }
}
+
if(please_quit) {
return;
}
@@ -280,6 +283,10 @@ void Application::event_keypress(SDLKey key) {
case SDLK_ESCAPE:
quit();
break;
+ case SDLK_SPACE:
+ paused = !paused;
+ lasttick = SDL_GetTicks();
+ break;
default:
break;
}