diff options
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r-- | src/graphics.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 7da5520c..94c23704 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -148,4 +148,13 @@ void Graphics::updateScreen() else { SDL_Flip(screen); } + + // Decrement frame counter when using framerate limiting + if (framesToDraw > 1) framesToDraw--; + + // Wait while we're not allowed to draw next frame yet + while (framesToDraw == 1) + { + SDL_Delay(10); + } } |