From 0d8b2449cf1bb8038481fd10865455b8f0893dc4 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 15 Dec 2017 16:19:47 +1100 Subject: [PATCH] [client] added back missing vsync disable option --- client/lg-renderer.h | 3 ++- client/main.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/lg-renderer.h b/client/lg-renderer.h index 5fc9d05a..d139ffeb 100644 --- a/client/lg-renderer.h +++ b/client/lg-renderer.h @@ -41,6 +41,7 @@ typedef struct LG_RendererParams TTF_Font * font; bool showFPS; bool resample; + bool vsync; } LG_RendererParams; @@ -97,4 +98,4 @@ typedef struct LG_Renderer LG_RendererOnFrameEvent on_frame_event; LG_RendererRender render; } -LG_Renderer; +LG_Renderer; \ No newline at end of file diff --git a/client/main.c b/client/main.c index 2de22bf4..9e31d0cc 100644 --- a/client/main.c +++ b/client/main.c @@ -63,6 +63,7 @@ struct AppState struct AppParams { + bool vsync; bool autoResize; bool allowResize; bool keepAspect; @@ -84,6 +85,7 @@ struct AppParams struct AppState state; struct AppParams params = { + .vsync = true, .autoResize = false, .allowResize = true, .keepAspect = true, @@ -631,6 +633,7 @@ int run() lgrParams.font = state.font; lgrParams.resample = params.useMipmap; lgrParams.showFPS = params.showFPS; + lgrParams.vsync = params.vsync; Uint32 sdlFlags; // probe for a a suitable renderer @@ -846,7 +849,7 @@ void doHelp(char * app) " -M Don't hide the host cursor\n" "\n" " -m Disable mipmapping\n" - " -v Disable VSync\n" + " -v Disable VSYNC\n" " -k Enable FPS display\n" "\n" " -a Auto resize the window to the guest\n" @@ -900,7 +903,7 @@ void doLicense() int main(int argc, char * argv[]) { int c; - while((c = getopt(argc, argv, "hf:sc:p:jMmkanrdFx:y:w:b:l")) != -1) + while((c = getopt(argc, argv, "hf:sc:p:jMmvkanrdFx:y:w:b:l")) != -1) switch(c) { case '?': @@ -937,6 +940,10 @@ int main(int argc, char * argv[]) params.useMipmap = false; break; + case 'v': + params.vsync = false; + break; + case 'k': params.showFPS = true; break;