From: Brian Paul Date: Thu, 21 Sep 2006 15:16:36 +0000 (+0000) Subject: GLUT_FORCE_VISUAL env var to force glut to use a particular visual (debug only) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=81e0d73780362c3b2671bce9e49cb05930c747bc;p=mesa.git GLUT_FORCE_VISUAL env var to force glut to use a particular visual (debug only) --- diff --git a/src/glut/glx/glut_win.c b/src/glut/glx/glut_win.c index 9b9e6e30225..0f48e0ba339 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