[client] added back missing vsync disable option

This commit is contained in:
Geoffrey McRae 2017-12-15 16:19:47 +11:00
parent d1bd5b3115
commit 0d8b2449cf
2 changed files with 11 additions and 3 deletions

View File

@ -41,6 +41,7 @@ typedef struct LG_RendererParams
TTF_Font * font; TTF_Font * font;
bool showFPS; bool showFPS;
bool resample; bool resample;
bool vsync;
} }
LG_RendererParams; LG_RendererParams;
@ -97,4 +98,4 @@ typedef struct LG_Renderer
LG_RendererOnFrameEvent on_frame_event; LG_RendererOnFrameEvent on_frame_event;
LG_RendererRender render; LG_RendererRender render;
} }
LG_Renderer; LG_Renderer;

View File

@ -63,6 +63,7 @@ struct AppState
struct AppParams struct AppParams
{ {
bool vsync;
bool autoResize; bool autoResize;
bool allowResize; bool allowResize;
bool keepAspect; bool keepAspect;
@ -84,6 +85,7 @@ struct AppParams
struct AppState state; struct AppState state;
struct AppParams params = struct AppParams params =
{ {
.vsync = true,
.autoResize = false, .autoResize = false,
.allowResize = true, .allowResize = true,
.keepAspect = true, .keepAspect = true,
@ -631,6 +633,7 @@ int run()
lgrParams.font = state.font; lgrParams.font = state.font;
lgrParams.resample = params.useMipmap; lgrParams.resample = params.useMipmap;
lgrParams.showFPS = params.showFPS; lgrParams.showFPS = params.showFPS;
lgrParams.vsync = params.vsync;
Uint32 sdlFlags; Uint32 sdlFlags;
// probe for a a suitable renderer // probe for a a suitable renderer
@ -846,7 +849,7 @@ void doHelp(char * app)
" -M Don't hide the host cursor\n" " -M Don't hide the host cursor\n"
"\n" "\n"
" -m Disable mipmapping\n" " -m Disable mipmapping\n"
" -v Disable VSync\n" " -v Disable VSYNC\n"
" -k Enable FPS display\n" " -k Enable FPS display\n"
"\n" "\n"
" -a Auto resize the window to the guest\n" " -a Auto resize the window to the guest\n"
@ -900,7 +903,7 @@ void doLicense()
int main(int argc, char * argv[]) int main(int argc, char * argv[])
{ {
int c; 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) switch(c)
{ {
case '?': case '?':
@ -937,6 +940,10 @@ int main(int argc, char * argv[])
params.useMipmap = false; params.useMipmap = false;
break; break;
case 'v':
params.vsync = false;
break;
case 'k': case 'k':
params.showFPS = true; params.showFPS = true;
break; break;