diff options
author | Brian Paul <[email protected]> | 2006-09-21 15:16:36 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-09-21 15:16:36 +0000 |
commit | 81e0d73780362c3b2671bce9e49cb05930c747bc (patch) | |
tree | aedf57f283b2a316bbe8cbfcad08046121782982 /src/glut/glx | |
parent | b7d9b1e724b9e7b91679ba7b0608d72938e259da (diff) |
GLUT_FORCE_VISUAL env var to force glut to use a particular visual (debug only)
Diffstat (limited to 'src/glut/glx')
-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 |