From 0d8bcfe9ae10ab31b237e8a100d37f066b8f499f Mon Sep 17 00:00:00 2001 From: KentuckyCompass Date: Fri, 25 Jan 2013 17:24:50 -0800 Subject: [PATCH] tab key for turbo mode --- base/PCMain.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/base/PCMain.cpp b/base/PCMain.cpp index fdc88e2436..5a2c6c5bac 100644 --- a/base/PCMain.cpp +++ b/base/PCMain.cpp @@ -470,7 +470,7 @@ int main(int argc, char *argv[]) { InputState input_state; int framecount = 0; bool nextFrameMD = 0; - float t = 0; + float t = 0, lastT = 0; while (true) { input_state.accelerometer_valid = false; input_state.mouse_valid = true; @@ -528,7 +528,11 @@ int main(int argc, char *argv[]) { #ifdef PANDORA eglSwapBuffers(g_eglDisplay, g_eglSurface); #else - SDL_GL_SwapBuffers(); + if (!keys[SDLK_TAB] || t - lastT >= 1.0/60.0) + { + SDL_GL_SwapBuffers(); + lastT = t; + } #endif // Simple frame rate limiting