The Open Inventor graphics configuration management classes provide a platform-independent mechanism for chosing the best combination of graphics parameters and features available on your graphics hardware. It is no longer necessary to check all the pixel formats (on Win32) or all the visuals (on Unix) to find the best one. Of course, what is “best” depends on the graphics hardware capabilities of your system and on the set of graphic preferences you specify.
You can specify many different criteria: double/single buffer, raw stereo, OpenGL acceleration, overlays, Z-buffer depth size, RGBA/indexed colors and size, accumulation buffer and size, stencil buffer and size, etc. Each criterion may be required, forbidden, or preferred. The preferred criterion can be weighted with values ranging from 1 to the largest integer. The sum of all weights determines if one graphics configuration is better than another.
The graphics configuration management classes define three kinds of objects:
All the viewers based on SoXtGLWidget can use the graphics configuration template: the inherited method named setGraphicTemplate() can be used to specify the OpenGL graphic preferences.
In a viewer derived from SoXtGLWidget, a graphics device is internally used to find the best graphic config if a template is given via the setGraphicConfigTemplate() method. If none is found (because the template is too restrictive), then the template is ignored. The default values of a OpenGL graphics template are the same as the ones that the SoXtGLWidget heuristic looks for when building an OpenGL widget:
"Important" but not both.However, if setGraphicConfigTemplate***has* been called, then when **setPixelFormat is called, several PREFERRED template preferences are changed either to REQUIRED or to FORBIDDEN to ensure that the new pixel format is one of the best ones.
If setGraphicConfigTemplate has been called, several methods, including setDoubleBuffer and setStereo, will automatically modify the current template to indicate that the new state is REQUIRED.
setRGBAColor sets the integer color buffer depth (0-32 bits). For floating point rendering, use setFloatRGBAColor.
C++ : The following example shows how to get pixel format or visual information directly from the graphic configuration.
/WinGLGraphicConfig_object_stores_pixel_format/visual_information_data Example : SoXt/WinGLGraphicConfig object stores pixel format/visual information data
C++ :
C# : The following example shows how to get pixel format or visual information directly from the graphic configuration.
/visual_information_data Example : SoWinGLGraphicConfig object stores pixel format/visual information data
C# :