hide random home http://www.sgi.com/tech/openGL/mjk.xlib/subsection3_3_3.html (Silicon Surf Promotional CD, 01/1995)



Next: 3.4 Mixing Xlib and Up: 3 Advanced Xlib and Previous: 3.2 Double Buffering

3.3 Overlays

X has a convention for supporting overlay window via special visuals [2]. OpenGL can support rendering into overlay visuals. Even if an X server supports overlay visuals, you will need to make sure those visuals are OpenGL capable. The glXChooseVisual routine does allow you to specify the frame buffer layer for the visual you are interested in with the GLX_LEVEL attribute. This makes it easier to find OpenGL capable overlay visuals.

IRIS GL programmers are used to assuming the transparent pixel in an overlay visual is always zero. For X and OpenGL, this assumption is no longer valid. You should query the transparent mode and pixel specified by the SERVER_OVERLAY_VISUALS property to ensure portability.

IRIS GL programmers are also used to considering overlay planes as being ``built-in'' to IRIS GL windows. The X model for overlay planes considers an overlay window to be a separate window with its own window ID. To use overlays as one does in IRIS GL, you need to create a normal plane window, then create a child window in the overlay planes with the child's origin located at the origin of the parent. The child should be maintained to have the same size as the parent. Clear the overlay window to the transparent pixel value to see through to the parent normal plane window. Switching between the overlay and normal planes windows requires a glXMakeCurrent call.

It is likely that the overlay visuals will not support the same frame buffer capabilities as the normal plane visuals. You should avoid assuming overlay windows will have frame buffer capabilities such as depth buffers, stencil buffers, or accumulation buffers.


mjk@asd.sgi.com
Wed Oct 19 18:11:46 PDT 1994