summaryrefslogtreecommitdiffstats
path: root/src/glut/glx
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-09-21 15:16:36 +0000
committerBrian Paul <[email protected]>2006-09-21 15:16:36 +0000
commit81e0d73780362c3b2671bce9e49cb05930c747bc (patch)
treeaedf57f283b2a316bbe8cbfcad08046121782982 /src/glut/glx
parentb7d9b1e724b9e7b91679ba7b0608d72938e259da (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.c17
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