summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glslview.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/glslview.c b/glslview.c
index 18cc512..4ff4dd3 100644
--- a/glslview.c
+++ b/glslview.c
@@ -46,6 +46,7 @@
#endif
+static bool paused = false;
static float speed = 1.0;
static unsigned previous_ticks = 0;
@@ -98,7 +99,10 @@ static void check_reload(void) {}
static void update(void) {
unsigned ticks = SDL_GetTicks();
- current_time += speed * (ticks - previous_ticks);
+
+ if (!paused)
+ current_time += speed * (ticks - previous_ticks);
+
previous_ticks = ticks;
}
@@ -151,6 +155,10 @@ static void handle_input(const char *input) {
case '>':
if (speed < 0)
set_speed(-speed);
+ break;
+
+ case ' ':
+ paused = !paused;
}
}
}