summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2003-01-20 11:26:30 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2003-01-20 11:26:30 +0000
commit0ebc8384810b4f5dc6012e74270dbadac7c00100 (patch)
treef4975705b312db1ee9df9502341c8b19bada9b44 /progs
parent14a7a0525150b275bddd7ee1d1734dcb00b5f97c (diff)
Add USE_MINIGLX flags. Build as a miniglx application.
Diffstat (limited to 'progs')
-rw-r--r--progs/xdemos/glxgears.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
index 59691513e2c..e6c698a7275 100644
--- a/progs/xdemos/glxgears.c
+++ b/progs/xdemos/glxgears.c
@@ -33,10 +33,16 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <GL/gl.h>
+#define USE_MINI_GLX 1
+#if USE_MINI_GLX
+#include <GL/miniglx.h>
+#else
#include <X11/Xlib.h>
#include <X11/keysym.h>
-#include <GL/gl.h>
#include <GL/glx.h>
+#endif
+
#define BENCHMARK
@@ -346,13 +352,18 @@ make_window( Display *dpy, const char *name,
attr.background_pixel = 0;
attr.border_pixel = 0;
attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone);
- attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ attr.event_mask = StructureNotifyMask | ExposureMask
+#if !USE_MINI_GLX
+ | KeyPressMask
+#endif
+ ;
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
win = XCreateWindow( dpy, root, 0, 0, width, height,
0, visinfo->depth, InputOutput,
visinfo->visual, mask, &attr );
+#if !USE_MINI_GLX
/* set hints and properties */
{
XSizeHints sizehints;
@@ -365,6 +376,7 @@ make_window( Display *dpy, const char *name,
XSetStandardProperties(dpy, win, name, name,
None, (char **)NULL, 0, &sizehints);
}
+#endif
ctx = glXCreateContext( dpy, visinfo, NULL, True );
if (!ctx) {
@@ -382,7 +394,12 @@ make_window( Display *dpy, const char *name,
static void
event_loop(Display *dpy, Window win)
{
+#if USE_MINI_GLX
+ reshape(300, 300);
+#endif
+
while (1) {
+#if !USE_MINI_GLX
while (XPending(dpy) > 0) {
XEvent event;
XNextEvent(dpy, &event);
@@ -421,6 +438,7 @@ event_loop(Display *dpy, Window win)
}
}
}
+#endif
/* next frame */
angle += 2.0;