diff options
-rw-r--r-- | src/glut/glx/glut_win.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 |