Next | Prev | Up | Top | Contents | Index

Using Transparent Pixels

If you want a visual with transparent pixels, and GLX_RGBA is in attrib_list, call glXChooseVisual() and specify the GLX_TRANSPARENT_TYPE_EXT value GLX_TRANSPARENT_RGB_EXT.

If you want a transparent visual and GLX_RGBA is not in attrib_list, call glXChooseVisual() and specify the GLX_TRANSPARENT_TYPE_EXT value GLX_TRANSPARENT_INDEX_EXT.

Don't specify one of the following values in attrib_list because typically only one transparent color or index value is supported:

GLX_TRANSPARENT_INDEX_VALUE_EXT, GLX_TRANSPARENT_{RED|GREEN|BLUE|ALPHA}_VALUE_EXT

Once you have a transparent visual, you can query the transparent color value by calling glXGetConfig(). To get the transparent index value for visuals that support index rendering, use GLX_TRANSPARENT_INDEX_VALUE_EXT. For visuals that support RGBA rendering, use GLX_TRANSPARENT_{RED|GREEN|BLUE}_VALUE_EXT. The visual attribute GLX_TRANSPARENT_ALPHA_VALUE_EXT is included in the extension for future use.

"How to Create Overlays" presents an example program that uses a transparent visual for the overlay window.


Next | Prev | Up | Top | Contents | Index