int PEXSelectPixmapDepth( Display *display, int screen, int criteria_count, PEXUtPixmapDepthCriteria *criteria, int *depth_return, PEXColorApproxEntry *capx_info_return, int *select_criteria_return, unsigned int *unmet_criteria_return )
Invoke PEXSelectPixmapDepth as a utility that attempts to select a pixmap depth on the specified display and screen that meets the criteria of one of the criteria sets specified.
This utility returns a success/failure indicator and if successful, it returns information about the pixmap depth and PEX color approximation support for the pixmap depth in structure storage provided by the caller.
PEXSelectPixmapDepth supports a "degradation" sequence of criteria sets: specify the "preferred" characteristics in the first element of the criteria array, and progressively weaker or less desirable sets in subsequent elements. If the hard criterion from the first element of the criteria array is not met, then the utility evaluates the next criteria set.
The function returns color approximation information in capx_info_return. When no color approximation type is specified as a criterion, then this utility returns a suitable PEXColorSpace entry.
Criteria for pixmap depth selection are specified by two masks inside the criteria structure: Mask Bits for the Hard and Soft Criteria.
If a bit for a particular criterion is present in both masks then it is treated as a hard criterion.
For each bit that is set in a criteria mask, a corresponding field in the PEXUtPixmapDepthCriteria structure is expected to be set to appropriate values:
PEXUtDepth depth PEXUtColorApproxType color_approx_type PEXUtZBufferDepth z_buffer_depth PEXUtAlphaBufferDepth alpha_buffer_depth PEXUtAccumBufferDepth accum_buffer_depth PEXUtAccumBufferMinRed accum_buffer_min_red PEXUtAccumBufferMinGreen accum_buffer_min_green PEXUtAccumBufferMinBlue accum_buffer_min_blue
Depth refers to the depth of the pixmap.
Color_approx_type is mainly useful to applications that need PEXColorRange color approximation. If not specified, then this utility assumes that PEXColorSpace is acceptable, since this is the most common and natural method for most PEX applications. If it is set to PEXColorRange, the returned color approximation entry is initialized for an appropriate gray ramp.
Use the Z buffer depth criterion to specify a minimum depth criterion in terms of bits. If you intend to read the contents of a Z buffer, the function PEXGetAncillaryBufferInfo is useful for determining the format and range of the Z buffer values.
Specify alpha buffer depth as a criterion if you expect to use alpha blending functions that utilize a destination alpha buffer or intend to use alpha buffer transparency.
Specify some combination of the four accumulation buffer criteria if you intend to use accumulation buffers for multi-pass rendering.
The ability of this procedure to verify that criteria are met depends on information available from the PEX server, including its support for various interoperability conventions. In general, if a hard criterion cannot be determined to have been satisfied or not, it is considered to have not been met; if a soft criterion cannot be verified, then the utility acts as though it had been met but still returns the corresponding bit in unmet_criteria_return.
If two or more pixmap depths meet all the hard criteria, then the depth that meets the largest number of soft criteria is selected. If there is more than one depth that meets the same number of soft criteria, then the depth with the highest color resolution is chosen. The final criterion is that preference is given to visuals in the order that they are listed by the server.
See function return values.
For an overview, see PEXlib Access and Information Functions.