summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-08-07 22:02:27 +0100
committerBrian <brian.paul@tungstengraphics.com>2007-08-07 22:02:27 +0100
commite45b40381c51564e12a0a1216bd651679a553288 (patch)
treedbca9fafb39e62d8ff96c7e854725fa4a69c5ecb
parent90cc31f31bbc9039fcd9acab7d6e72f2c9a186bb (diff)
parse standard -geometry option
-rw-r--r--progs/xdemos/glxgears.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
index 2425a2fa11..ec431c16f0 100644
--- a/progs/xdemos/glxgears.c
+++ b/progs/xdemos/glxgears.c
@@ -433,7 +433,7 @@ make_window( Display *dpy, const char *name,
attr.override_redirect = fullscreen;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
- win = XCreateWindow( dpy, root, 0, 0, width, height,
+ win = XCreateWindow( dpy, root, x, y, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
@@ -556,7 +556,8 @@ usage(void)
int
main(int argc, char *argv[])
{
- int winWidth = 300, winHeight = 300;
+ unsigned int winWidth = 300, winHeight = 300;
+ int x = 0, y = 0;
Display *dpy;
Window win;
GLXContext ctx;
@@ -578,12 +579,8 @@ 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]);
+ else if (i < argc-1 && strcmp(argv[i], "-geometry") == 0) {
+ XParseGeometry(argv[i+1], &x, &y, &winWidth, &winHeight);
i++;
}
else {
@@ -599,7 +596,7 @@ main(int argc, char *argv[])
return -1;
}
- make_window(dpy, "glxgears", 0, 0, winWidth, winHeight, &win, &ctx);
+ make_window(dpy, "glxgears", x, y, winWidth, winHeight, &win, &ctx);
XMapWindow(dpy, win);
glXMakeCurrent(dpy, win, ctx);