From 16db15718dcb109c9c02ef8c2611ae973a6dbbe6 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 20 Dec 2004 14:48:19 +0000 Subject: Add a -fullscreen option --- progs/xdemos/glxgears.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'progs') diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c index a4a9c5e3f4..8700e2773f 100644 --- a/progs/xdemos/glxgears.c +++ b/progs/xdemos/glxgears.c @@ -85,6 +85,7 @@ static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0; static GLint gear1, gear2, gear3; static GLfloat angle = 0.0; +static GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */ static GLboolean stereo = GL_FALSE; /* Enable stereo. */ static GLfloat eyesep = 5.0; /* Eye separation. */ static GLfloat fix_point = 40.0; /* Fixation point distance. */ @@ -398,6 +399,12 @@ make_window( Display *dpy, const char *name, scrnum = DefaultScreen( dpy ); root = RootWindow( dpy, scrnum ); + if (fullscreen) { + x = 0; y = 0; + width = DisplayWidth( dpy, scrnum ); + height = DisplayHeight( dpy, scrnum ); + } + if (stereo) visinfo = glXChooseVisual( dpy, scrnum, stereoAttribs ); else @@ -416,7 +423,8 @@ make_window( Display *dpy, const char *name, attr.border_pixel = 0; attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask; - mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; + attr.override_redirect = fullscreen; + mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect; win = XCreateWindow( dpy, root, 0, 0, width, height, 0, visinfo->depth, InputOutput, @@ -544,6 +552,9 @@ main(int argc, char *argv[]) else if (strcmp(argv[i], "-stereo") == 0) { stereo = GL_TRUE; } + else if (strcmp(argv[i], "-fullscreen") == 0) { + fullscreen = GL_TRUE; + } else printf("Warrning: unknown parameter: %s\n", argv[i]); } -- cgit v1.2.3