summaryrefslogtreecommitdiffstats
path: root/progs/xdemos
diff options
context:
space:
mode:
Diffstat (limited to 'progs/xdemos')
-rw-r--r--progs/xdemos/.gitignore5
-rw-r--r--progs/xdemos/Makefile22
-rw-r--r--progs/xdemos/glxgears.c13
-rw-r--r--progs/xdemos/glxswapcontrol.c5
4 files changed, 31 insertions, 14 deletions
diff --git a/progs/xdemos/.gitignore b/progs/xdemos/.gitignore
index 4adffda2d1e..f959ef26ec9 100644
--- a/progs/xdemos/.gitignore
+++ b/progs/xdemos/.gitignore
@@ -1,6 +1,8 @@
glthreads
+glxcontexts
glxdemo
glxgears
+glxgears_fbconfig
glxheads
glxinfo
glxpixmap
@@ -8,9 +10,12 @@ glxpbdemo
glxswapcontrol
manywin
offset
+overlay
pbinfo
pbdemo
+texture_from_pixmap
wincopy
xdemo
xfont
xrotfontdemo
+yuvrect_client
diff --git a/progs/xdemos/Makefile b/progs/xdemos/Makefile
index d1d7fecea1c..c585026ad38 100644
--- a/progs/xdemos/Makefile
+++ b/progs/xdemos/Makefile
@@ -38,7 +38,7 @@ PROGS = glthreads \
.SUFFIXES: .c
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
+ $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@
##### TARGETS #####
@@ -53,32 +53,32 @@ clean:
# special cases
pbinfo: pbinfo.o pbutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@
+ $(CC) $(LDFLAGS) pbinfo.o pbutil.o $(APP_LIB_DEPS) -o $@
pbdemo: pbdemo.o pbutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@
+ $(CC) $(LDFLAGS) pbdemo.o pbutil.o $(APP_LIB_DEPS) -o $@
pbinfo.o: pbinfo.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbinfo.c
+ $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c
pbdemo.o: pbdemo.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbdemo.c
+ $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbdemo.c
pbutil.o: pbutil.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(CFLAGS) pbutil.c
+ $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c
glxgears_fbconfig: glxgears_fbconfig.o pbutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@
+ $(CC) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(APP_LIB_DEPS) -o $@
glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h
- $(CC) -I$(INCDIR) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
+ $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
xrotfontdemo: xrotfontdemo.o xuserotfont.o
- $(CC) -I$(INCDIR) $(CFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@
+ $(CC) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(APP_LIB_DEPS) -o $@
xuserotfont.o: xuserotfont.c xuserotfont.h
- $(CC) -c -I. -I$(INCDIR) $(CFLAGS) xuserotfont.c
+ $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c
xrotfontdemo.o: xrotfontdemo.c xuserotfont.h
- $(CC) -c -I. -I$(INCDIR) $(CFLAGS) xrotfontdemo.c
+ $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xrotfontdemo.c
diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
index 75d63e51a2e..ec431c16f00 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 );
@@ -548,13 +548,16 @@ 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;
+ unsigned int winWidth = 300, winHeight = 300;
+ int x = 0, y = 0;
Display *dpy;
Window win;
GLXContext ctx;
@@ -576,6 +579,10 @@ main(int argc, char *argv[])
else if (strcmp(argv[i], "-fullscreen") == 0) {
fullscreen = GL_TRUE;
}
+ else if (i < argc-1 && strcmp(argv[i], "-geometry") == 0) {
+ XParseGeometry(argv[i+1], &x, &y, &winWidth, &winHeight);
+ i++;
+ }
else {
usage();
return -1;
@@ -589,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);
diff --git a/progs/xdemos/glxswapcontrol.c b/progs/xdemos/glxswapcontrol.c
index d9be984be57..e429d58ecc4 100644
--- a/progs/xdemos/glxswapcontrol.c
+++ b/progs/xdemos/glxswapcontrol.c
@@ -814,6 +814,11 @@ main(int argc, char *argv[])
init();
+ /* Set initial projection/viewing transformation.
+ * same as glxgears.c
+ */
+ reshape(300, 300);
+
event_loop(dpy, win);
glXDestroyContext(dpy, ctx);