Re: [PATCH] simple help for glxgears.c
- To: Brian Paul <brian.paul@tungstengraphics.com>
- Cc: Debian X Strike Force <debian-x@lists.debian.org>
- Subject: Re: [PATCH] simple help for glxgears.c
- From: Jeff Carr <basilarchia@gmail.com>
- Date: Fri, 12 May 2006 18:23:39 -0700
- Message-id: <[🔎] 4465351B.1000308@gmail.com>
- In-reply-to: <44651BE5.6050103@tungstengraphics.com>
- References: <444C4582.4040106@teco.edu> <444E2251.7010808@sms.ed.ac.uk> <20060425133215.GA31389@suse.de> <444E32A3.9030003@tungstengraphics.com> <446518D3.7070905@gmail.com> <44651BE5.6050103@tungstengraphics.com>
On 05/12/06 16:36, Brian Paul wrote:
> Jeff Carr wrote:
>> I can't ever remember -printfps for glxgears. -h and --help options
>> would be helpful.
>
> Which version of glxgears is this against? It doesn't apply to the
> version in Mesa CVS head:
>
> http://webcvs.freedesktop.org/mesa/Mesa/progs/xdemos/glxgears.c?rev=1.13&view=markup
My bad. It's from debian sid. I see now, the packagers of mesa-utils
changed the behavior so that -printfps is required with a comment about
it being a meaningless benchmark. That's not true for me; it's a very
useful way to tell approximately how things are working. Like bogomips.
Either way, here is a simple patch to add usage() like you have in glxinfo.c
Sorry about the noise,
Jeff
--- old/glxgears.c 2006-05-12 18:20:59.000000000 -0700
+++ new/glxgears.c 2006-05-12 18:20:36.000000000 -0700
@@ -539,6 +539,15 @@
}
}
+static void
+usage(void)
+{
+ printf("Usage: glxgears [-fullscreen] [-stereo] [-display <dname>]\n");
+ printf("\t-fullscreen: run in fullscreen mode.\n");
+ printf("\t-stereo: run in stereo mode.\n");
+ printf("\t-display <dname>: Print GLX visuals on specified server.\n");
+ printf("\t-h: This information.\n");
+}
int
main(int argc, char *argv[])
@@ -564,8 +573,15 @@
else if (strcmp(argv[i], "-fullscreen") == 0) {
fullscreen = GL_TRUE;
}
- else
- printf("Warrning: unknown parameter: %s\n", argv[i]);
+ else if ((strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "--help") == 0)) {
+ usage();
+ return 0;
+ }
+ else {
+ printf("Unknown option `%s'\n", argv[i]);
+ usage();
+ return 0;
+ }
}
dpy = XOpenDisplay(dpyName);
Reply to: