From 4a8ad16ec0ab57bfa077c96f502cade7e656c01a Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Tue, 7 Aug 2007 09:53:48 +0200 Subject: [PATCH] glxgears: Add an x/y window size parameter. --- progs/xdemos/glxgears.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c index 75d63e51a2e..2425a2fa11c 100644 --- a/progs/xdemos/glxgears.c +++ b/progs/xdemos/glxgears.c @@ -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 window width (default: 300)\n"); + printf(" -winheight 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; -- 2.30.2