PEXGetZBuffer - Get Z-Buffer (5.2)


Synopsis

 
   PEXPointer PEXGetZBuffer(
         Display *display,
         PEXRenderer renderer,
         int x,
         int y,
         unsigned int width,
         unsigned int height
   )
 

Arguments

display
A pointer to a display structure returned by a successful XOpenDisplay call.

renderer The resource identifier of the renderer of which the Z-buffer is to be queried.

x,y
The DC origin of the Z-buffer rectangle to be queried.

width
The DC size (width) forming the Z-buffer rectangle to be queried.

height
The DC size (height) forming the Z-buffer rectangle to be queried.

Returns

A pointer to the Z-buffer values; a null pointer if unsuccessful.

Description

Invoke PEXGetZBuffer to get the content of the Z-buffer.

If the renderer state attribute of the renderer specified by renderer is PEXRendering or PEXMultipassRendering, then the implementation returns a pointer to the content of the Z-buffer described by the given rectangle. The validity of the values returned if the renderer state is PEXPicking is implementation-dependent. If the renderer state is PEXIdle, then the implementation returns a null pointer.

The x and y coordinates, specified in device coordinates, are relative to the renderer's current drawable origin and define the upper left corner of the rectangle. The width and height, specified in pixels, are inclusive. The function returns a null pointer if the rectangle is not contained within the drawable. The returned data is undefined for any part of the rectangle that is obscured. The renderer does not consider the clip list when executing this function.

The function returns the values row by row, starting with the upper left of the rectangle. The implementation maps the device-specific Z-buffer values into the range of [0.0, 1.0] in DC space and the returned values are of type float.

To determine implementation specific information about the Z-buffer, see the PEXGetAncillaryBufferInfo function.

PEXlib allocates the memory for the returned Z-buffer values. Invoke XFree to deallocate the memory.

Errors

BadAlloc
The implementation failed to allocate a Z-buffer.

BadMatch
The drawable associated with the renderer cannot have a Z-buffer.

BadPEXRenderer
The specified renderer resource identifier is invalid.

See Also

For a list of all Renderer functions and related topics, see Rendering.