PEXBeginPickAll - Begin Renderer Pick All (5.1)

Synopsis

 
   void PEXBeginPickAll(
        Display *display,
        Drawable drawable,
        PEXRenderer renderer,
        long structure_id,
        int method,
        int send_event,
        int max_hits,
        int pick_device_type,
        PEXPickRecord *pick_record
   )
 

Arguments

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

drawable
The resource identifier of a drawable.

renderer
The resource identifier of the renderer.

structure_id A value to be used as an application-specified structure identifier.

method
The pick all method (PEXPickAllAll or PEXPickAllVisible).

send_event
Specifies whether the implementation should send an event when the maximum number of hits is reached (True or False).

max_hits
The maximum number of hits to be returned.

pick_device_type
The pick device type (PEXPickDeviceDCHitBox or PEXPickDeviceNPCHitVolume).

pick_record
A pointer to the pick data record.

Returns

None.

Description

Invoke PEXBeginPickAll to start an immediate-mode pick, setting the renderer's renderer state to PEXPicking.

When the renderer state is PEXPicking, primitives are hit tested instead of converted to pixels. All picked primitives are recorded until the maximum hits specified. Additional picked primitives are not recorded. Once the maximum number of hits is reached, then the implementation may ignore subsequent primitives.

Inquire the supported pick device types by invoking the PEXGetEnumTypeInfo function.

The specified structure identifier is inserted as the first structure component in the returned pick path(s).

PEXlib defines two standard pick methods:

PEXPickAllAll -
Returns the primitives, up to the maximum number of hits, which lie within or intersect the hit box.

PEXPickAllVisible -
Returns the primitives visible (after HLHSR), up to the maximum number of hits, and that lie within or intersect the hit box.

If the send event flag is True and the pick method is PEXPickAllAll, then a PEXMaxHitsReached event is sent from the implementation to the client whenever implementation reaches the specified maximum number of hits, if the implementation supports the event. To determine the maximum number of supported hits, invoke the PEXGetImpDepConstants function. Upon receiving the event, the application should stop sending primitives and process the recorded hits. If the pick method is PEXPickAllVisible, then a complete set of primitives must be sent to the implementation before the implementation can determine which primitives to select.

If the specified drawable does not have the same root and depth as the drawable used to create the renderer, or, if the specified drawable is not one of the supported drawables, then the implementation issues a BadMatch error. To determine the supported drawables, invoke the PEXMatchRenderingTargets function. If the renderer state is set to PEXRendering, PEXMultipassRendering or PEXPicking when this function is called, then the operation in progress is aborted, the PEXBeginPickAll function is completed, and the implementation issues a BadPEXRendererState error.

When the renderer state is PEXPicking, you can invoke any function which processes output commands or manipulates attributes (e.g., all output command functions, PEXBeginStructure, PEXEndStructure, PEXRenderElements, and PEXAccumulateState). These functions have the same semantics except that primitives are hit tested instead of converted to pixels.

Errors

BadAlloc
The implementation failed to allocate resources necessary to complete request.

BadDrawable
The specified drawable resource identifier is invalid.

BadMatch
The specified drawable is unsupported, or the specified renderer resource was not created with a compatible drawable.

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXRendererState
The specified renderer was not PEXIdle.

BadValue
The pick record contains invalid data, or the pick device type is invalid.

See Also

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