glxgears: Add an x/y window size parameter.
authorIngo Molnar <mingo@elte.hu>
Tue, 7 Aug 2007 07:53:48 +0000 (09:53 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 7 Aug 2007 07:57:02 +0000 (09:57 +0200)
progs/xdemos/glxgears.c

index 75d63e5..2425a2f 100644 (file)
@@ -548,13 +548,15 @@ usage(void)
    printf("  -stereo                 run in stereo mode\n");
    printf("  -fullscreen             run in fullscreen mode\n");
    printf("  -info                   display OpenGL renderer info\n");
+   printf("  -winwidth <width>       window width (default: 300)\n");
+   printf("  -winheight <height>     window height (default: 300)\n");
 }
  
 
 int
 main(int argc, char *argv[])
 {
-   const int winWidth = 300, winHeight = 300;
+   int winWidth = 300, winHeight = 300;
    Display *dpy;
    Window win;
    GLXContext ctx;
@@ -576,6 +578,14 @@ main(int argc, char *argv[])
       else if (strcmp(argv[i], "-fullscreen") == 0) {
          fullscreen = GL_TRUE;
       }
+      else if (i < argc-1 && strcmp(argv[i], "-winwidth") == 0) {
+         winWidth = atoi(argv[i+1]);
+         i++;
+      }
+      else if (i < argc-1 && strcmp(argv[i], "-winheight") == 0) {
+         winHeight = atoi(argv[i+1]);
+         i++;
+      }
       else {
          usage();
          return -1;