mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] added ability to pass options to renderers
This commit is contained in:
parent
deee61efa9
commit
f3e19b743c
@ -38,6 +38,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
typedef struct LG_RendererParams
|
||||
{
|
||||
int argc;
|
||||
const char ** argv;
|
||||
TTF_Font * font;
|
||||
bool showFPS;
|
||||
bool resample;
|
||||
|
@ -83,6 +83,10 @@ struct AppParams
|
||||
bool scaleMouseInput;
|
||||
bool hideMouse;
|
||||
bool ignoreQuit;
|
||||
|
||||
unsigned int rendererOptSize;
|
||||
unsigned int rendererOptCount;
|
||||
const char ** rendererOpts;
|
||||
};
|
||||
|
||||
struct AppState state;
|
||||
@ -716,6 +720,8 @@ int run()
|
||||
}
|
||||
|
||||
LG_RendererParams lgrParams;
|
||||
lgrParams.argc = params.rendererOptCount;
|
||||
lgrParams.argv = params.rendererOpts;
|
||||
lgrParams.font = state.font;
|
||||
lgrParams.resample = params.useMipmap;
|
||||
lgrParams.showFPS = params.showFPS;
|
||||
@ -936,6 +942,7 @@ void doHelp(char * app)
|
||||
" -m Disable mipmapping\n"
|
||||
" -v Disable VSYNC\n"
|
||||
" -k Enable FPS display\n"
|
||||
" -o FLAG Specify a renderer flag\n"
|
||||
"\n"
|
||||
" -a Auto resize the window to the guest\n"
|
||||
" -n Don't allow the window to be manually resized\n"
|
||||
@ -989,7 +996,7 @@ void doLicense()
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
int c;
|
||||
while((c = getopt(argc, argv, "hf:sc:p:jMmvkanrdFx:y:w:b:Ql")) != -1)
|
||||
while((c = getopt(argc, argv, "hf:sc:p:jMmvko:anrdFx:y:w:b:Ql")) != -1)
|
||||
switch(c)
|
||||
{
|
||||
case '?':
|
||||
@ -1034,6 +1041,17 @@ int main(int argc, char * argv[])
|
||||
params.showFPS = true;
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
if (params.rendererOptCount == params.rendererOptSize)
|
||||
{
|
||||
params.rendererOptSize += 5;
|
||||
params.rendererOpts = realloc(
|
||||
params.rendererOpts,
|
||||
params.rendererOptSize * sizeof(char *));
|
||||
}
|
||||
params.rendererOpts[params.rendererOptCount++] = optarg;
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
params.autoResize = true;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user