From 81e0d73780362c3b2671bce9e49cb05930c747bc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 21 Sep 2006 15:16:36 +0000 Subject: [PATCH] GLUT_FORCE_VISUAL env var to force glut to use a particular visual (debug only) --- src/glut/glx/glut_win.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/glut/glx/glut_win.c b/src/glut/glx/glut_win.c index 9b9e6e3..0f48e0b 100644 --- a/src/glut/glx/glut_win.c +++ b/src/glut/glx/glut_win.c @@ -349,13 +349,30 @@ getVisualInfoRGB(unsigned int mode) __glutScreen, list); } +static XVisualInfo * +getVisualInfoID(int id) +{ + XVisualInfo temp; + int count; + temp.visualid = id; + return XGetVisualInfo(__glutDisplay, VisualIDMask, &temp, &count); +} + + XVisualInfo * __glutGetVisualInfo(unsigned int mode) { + char *visStr; /* XXX GLUT_LUMINANCE not implemented for GLUT 3.0. */ if (GLUT_WIND_IS_LUMINANCE(mode)) return NULL; + visStr = getenv("GLUT_FORCE_VISUAL"); + if (visStr) { + int id = atoi(visStr); + return getVisualInfoID(id); + } + if (GLUT_WIND_IS_RGB(mode)) return getVisualInfoRGB(mode); else -- 2.7.4