::Visual* Display::getVisual (VisualID visualID) { XVisualInfo info; if (getVisualInfo(visualID, info)) return info.visual; return DE_NULL; }
XVisualInfo * __glutDetermineVisual( unsigned int displayMode, Bool * treatAsSingle, XVisualInfo * (getVisualInfo) (unsigned int)) { XVisualInfo *vis; /* Should not be looking at display mode mask if __glutDisplayString is non-NULL. */ assert(!__glutDisplayString); *treatAsSingle = GLUT_WIND_IS_SINGLE(displayMode); vis = getVisualInfo(displayMode); if (!vis) { /* Fallback cases when can't get exactly what was asked for... */ if (GLUT_WIND_IS_SINGLE(displayMode)) { /* If we can't find a single buffered visual, try looking for a double buffered visual. We can treat a double buffered visual as a single buffer visual by changing the draw buffer to GL_FRONT and treating any swap buffers as no-ops. */ displayMode |= GLUT_DOUBLE; vis = getVisualInfo(displayMode); *treatAsSingle = True; } if (!vis && GLUT_WIND_IS_MULTISAMPLE(displayMode)) { /* If we can't seem to get multisampling (ie, not Reality Engine class graphics!), go without multisampling. It is up to the application to query how many multisamples were allocated (0 equals no multisampling) if the application is going to use multisampling for more than just antialiasing. */ displayMode &= ~GLUT_MULTISAMPLE; vis = getVisualInfo(displayMode); } } return vis; }