PEXNextPass - Next Pass (Multipass Rendering) (5.2)


Synopsis

 
   int PEXNextPass(
       Display *display,
       PEXRenderer renderer,
       int next_pass
   )
 

Arguments

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

renderer
The resource identifier of the renderer.

next_pass
Specifies when the implementation should complete processing (PEXMultipassContinue, PEXMultipassLastPass or PEXMultipassAbort).

Returns

Number of passes required to complete multipass operation.

Description

Invoke PEXNextPass to signify the end of a multipass-rendering pass for the renderer identified by renderer, and, if applicable, the beginning of the next pass for that renderer.

The renderer executes any processing necessary to finish the pass. The number of additional passes required, if known, is returned by this function.

PEXlib defines the following values for next_pass:

PEXMultipassContinue -
the implementation prepares to receive the next pass, which the client is expected to send unless the return value is 0.

PEXMultipassLastPass -
the implementation prepares to complete the multipass operation with only one more pass. The implementation produces the best output it can using the multipass algorithms it is currently using for the multipass session. The client is expected to send the additional pass unless the return value is 0.

PEXMultipassAbort -
the implementation terminates the multipass session. The effect on the rendered image is implementation-dependent. The renderer state is changed to PEXRendering. The number of additional passes that were required, if known, for this multipass session are returned by the function.

If the client sends an additional pass when that pass was not required, then the result is implementation-dependent.

Except where defined otherwise in this description, the returned value indicates whether additional passes are needed to complete the current multipass session. A value of zero indicates that rendering is complete and that this request caused the renderer state to become PEXRendering. A value of -1 indicates that the number of passes needed to complete rendering is unknown, and the client is expected to send passes until a count of zero is returned.

When a multipass session ends, whether fully completed or prematurely terminated, all resources other than the frame buffer, such as the Z-buffer and accumulation buffers, are left in an implementation-dependent state. Therefore, continuing in single-pass rendering mode after completing multipass typically requires initialization of all applicable states and resources.

Errors

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadValue
The next_pass argument contains an invalid value.

See Also

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