Cannot get visual occurs when the requested display attributes are not available. So for example asking for double buffered 8 bit rgb and 24 bit z and 8 bit stencil for example may not have an equivalent visual format on your X server.
In irisgl the calls are winopen() and gconfig() (ahh life used to be simple) with requested attributes in between. It looks like iobounce simply requests double buffering and relies on defaults for the rest. What attributes does that port to…?
Looking at the GLX code it generates you have:
static int attributeList[] = { GLX_DOUBLEBUFFER,
None };
vi = glXChooseVisual(dpy, DefaultScreen(dpy),
attributeList);
Asking for a double buffered nothing may be a problem
So add a few attributes to that list. It’s best to rewrite this part of visual selection with fallbacks etc, because you need portability and visual config seems to be an unslayable bugbear. Tip requesting 1 bit of anything is a good way to wildcard stuff like zbuffer size (although it may not be the most efficient visual).
You can see that zrgb requests RGBA (i.e it asks for alpha) and has a fallback request to make sure it’s a bit more robust and asks for 1 bit of each attribute to maximize compatability, in addition to requesting color and zbuffer it falls back on single buffered rendering if the initial request fails. This is inherently more robust. I would suggest that you fall back to a visual with no destination alpha before defaulting to single buffered rendering.
static int attributeList[] = { GLX_RGBA,
GLX_DOUBLEBUFFER,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
None };
static int attributeList2[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
GLX_DEPTH_SIZE, 1,
None };
vi = glXChooseVisual(dpy, DefaultScreen(dpy),
attributeList);
if (vi == NULL) {
fprintf(stderr, "Unable to obtain visual
Doublebuffered visual
");
vi = glXChooseVisual(dpy, DefaultScreen(dpy),
attributeList2);
}
There are other ways to do this such as enumerating visuals and checking for suitability vs. your needs.
Either way this is your problem and the solution is obvious. Things will get much more interesting when you run your own code through this, alas tevbind we barely knew ye (and ofcourse they threw out the texbind baby with the bathwater on 1.0) …ancient history… irisgl was fun.