From 8460cc9bf9e3e6f237add35c1a635f137e57c184 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 2 Feb 2000 20:57:51 +0000 Subject: [PATCH] try both single and double-buffered visuals --- progs/xdemos/glxinfo.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index d4caf9478a5..f7890ee2c9b 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -1,4 +1,4 @@ -/* $Id: glxinfo.c,v 1.3 2000/01/27 16:53:55 brianp Exp $ */ +/* $Id: glxinfo.c,v 1.4 2000/02/02 20:57:51 brianp Exp $ */ /* * Copyright (C) 1999 Brian Paul All Rights Reserved. @@ -131,11 +131,20 @@ static void print_screen_info(Display *dpy, int scrnum) { Window win; - int attrib[] = { GLX_RGBA, - GLX_RED_SIZE, 1, - GLX_GREEN_SIZE, 1, - GLX_BLUE_SIZE, 1, - None }; + int attribSingle[] = { + GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + None }; + int attribDouble[] = { + GLX_RGBA, + GLX_RED_SIZE, 1, + GLX_GREEN_SIZE, 1, + GLX_BLUE_SIZE, 1, + GLX_DOUBLEBUFFER, + None }; + XSetWindowAttributes attr; unsigned long mask; Window root; @@ -145,10 +154,13 @@ print_screen_info(Display *dpy, int scrnum) root = RootWindow(dpy, scrnum); - visinfo = glXChooseVisual(dpy, scrnum, attrib); + visinfo = glXChooseVisual(dpy, scrnum, attribSingle); if (!visinfo) { - fprintf(stderr, "Error: couldn't find RGB GLX visual!\n"); - return; + visinfo = glXChooseVisual(dpy, scrnum, attribDouble); + if (!visinfo) { + fprintf(stderr, "Error: couldn't find RGB GLX visual!\n"); + return; + } } attr.background_pixel = 0; -- 2.30.2