diff options
-rw-r--r-- | glslview.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; } } } |