From: Allen A. <ak...@po...> - 2000-10-05 22:41:43
|
On Thu, Oct 05, 2000 at 02:36:30PM -0700, Michael Vance wrote: | On Thu, Oct 05, 2000 at 11:43:10AM -0600, Brian Paul wrote: | | > glXChooseVisual() really is poorly designed. Serious apps should | > avoid it and use a better visual selection method. | | Such as? Since 1994 I've been using the visinfo package that I wrote while at SGI. Among other things, it's used in isfast and glean, and it had some influence on Mark Kilgard's design for the display initialization string in GLUT. With visinfo, you write short Boolean expressions involving attribute variables and C operators that say exactly what visual attributes you want, plus sort keys that determine which visual is returned first if more than one meets the selection criteria. That way you don't run into the ambiguities that cause problems for glXChooseVisual(). Examples: "max rgb, max z" Deepest color buffer, deepest depth buffer -- roughly what glXChooseVisual is supposed to return if you specify nonzero color and depth attributes. "max rgb, z == 16, db" Deepest color buffer; depth buffer must be exactly 16 bits; double-buffered. "max rgb, min z" Deepest color buffer; shallowest available nonzero depth buffer. "max rgba, fast, conformant, accumrgba >= 2*rgba" Deepest RGBA that's hardware accelerated, passes the OpenGL conformance tests, and has an accumulation buffer at least twice as deep as the color buffer. "r%2 || g%2 || b%2, !s" Color buffer in which at least one channel has an odd number of bits; no stencil planes. And so on. This has enough expressive power that I've never felt the need for anything else, and it's been ported to most systems running OpenGL so it has relatively good availability. However, you can always roll your own using glXGetConfig() or other window-system-dependent query function.. Allen |