GLUT_FORCE_VISUAL env var to force glut to use a particular visual (debug only)

This commit is contained in:
Brian Paul
2006-09-21 15:16:36 +00:00
parent b7d9b1e724
commit 81e0d73780
+17
View File
@@ -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