Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP VISUALIZE-IVL Documentation: HP 9000 Series 700 Computers > Appendix B Appendix B: HP-IVL Reference

glXChooseVisual

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Return a visual that matches specified attributes.

C Specification

   XVisualInfo* glXChooseVisual(Display *dpy,

                                int      screen,

                                int     *attribList)

Parameters

dpy

Specifies the connection to the X server.

screen

Specifies the screen number.

attribList

Specifies a list of Boolean attributes and integer attribute/value pairs. The last attribute must be None.

Description

glXChooseVisual returns a pointer to an XVisualInfo structure describing the visual that best meets a minimum specification. The Boolean GLX attributes of the visual that is returned will match the specified values, and the integer GLX attributes will meet or exceed the specified minimum values. If all other attributes are equivalent, then TrueColor and PseudoColor visuals have priority over DirectColor and StaticColor visuals, respectively. If no conforming visual exists, NULL is returned. To free the data returned by this function, use XFree.

The interpretations of the various GLX visual attributes are as follows:

  • GLX_LEVEL Must be followed by an integer buffer-level specification. This specification is honored exactly. Buffer level zero corresponds to the default frame buffer of the display. Buffer level one is the first overlay frame buffer, level two the second overlay frame buffer, and so on. Negative buffer levels correspond to underlay frame buffers.

  • GLX_RGBA If present, only visuals that support RGBA rendering are considered.

  • GLX_DOUBLEBUFFER If present, only double-buffered visuals are considered. Otherwise, only single-buffered visuals are considered.

  • GLX_RED_SIZE Must be followed by a non-negative minimum size specification. If this value is zero, the smallest available red buffer is preferred. Otherwise, the largest available red buffer of at least the minimum size is preferred.

  • GLX_GREEN_SIZE Must be followed by a non-negative minimum size specification. If this value is zero, the smallest available green buffer is preferred. Otherwise, the largest available green buffer of at least the minimum size is preferred.

  • GLX_BLUE_SIZE Must be followed by a non-negative minimum size specification. If this value is zero, the smallest available blue buffer is preferred. Otherwise, the largest available blue buffer of at least the minimum size is preferred.

  • GLX_ALPHA_SIZE Must be followed by a non-negative minimum size specification. If this value is zero, the smallest available alpha buffer is preferred. Otherwise, the largest available alpha buffer of at least the minimum size is preferred.

  • GLX_X_VISUAL_TYPE_EXT Must be followed by an X visual type (one of TrueColor, DirectColor, PseudoColor, StaticColor, GrayScale, or StaticGray). If present, only visuals of the specified type will be considered.

Defaults

All Boolean GLX attributes default to False. All integer GLX attributes default to zero. Default specifications are superseded by attributes included in attribList. Boolean attributes included in attribList are understood to be True. Integer attributes are followed immediately by the corresponding desired or minimum value. The list must be terminated with None.

Examples

   attribList = {GLX_RGBA, GLX_RED_SIZE, 4, GLX_GREEN_SIZE, 4,

                 GLX_BLUE_SIZE, 4, None};

Specifies a single-buffered RGBA visual in the normal frame buffer, not an overlay or underlay buffer. The returned visual supports at least four bits each of red, green, and blue, and possibly no bits of alpha. It does not support double-buffering.

Notes

XVisualInfo is defined in Xutil.h. It is a structure that includes visual, visual ID, screen, and depth elements.

glXChooseVisual is implemented as a client-side utility using only XGetVisualInfo and glXGetConfig. Calls to these two routines can be used to implement selection algorithms other than the generic one implemented by glXChooseVisual.

GLX implementors are strongly discouraged, but not prohibited, from changing the selection algorithm used by glXChooseVisual. Therefore, selections may change from release to release of the client-side library.

There is no direct filter for picking only visuals that support GLXPixmaps. GLXPixmaps are supported for visuals whose GLX_BUFFER_SIZE is one of the pixmap depths supported by the X server.

The first release of IVL only supports visuals for RGBA rendering.

Errors

NULL is returned if an undefined GLX attribute is encountered in attribList.

See Also

glXCreateContext, glXGetConfig, XGetVisualInfo (for X, not GLX, visuals).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.