PEXOCCSetLightSourceState - Set Light Source State (5.0)


Synopsis

   void PEXOCCSetLightSourceState(
        PEXOCC context,
        unsigned int enable_count,
        PEXTableIndex *enable,
        unsigned int disable_count,
        PEXTableIndex *disable
    )
 

 
   void PEXSetLightSourceState(
        Display *display,
        XID resource_id,
        PEXOCRequestType req_type,
        unsigned int enable_count,
        PEXTableIndex *enable,
        unsigned int disable_count,
        PEXTableIndex *disable
   )
 

Arguments

context
An OC context returned by a successful PEXCreateOCC call.

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

resource_id (OCC)
The resource identifier of the renderer or structure.

req_type (OCC)
The request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).

enable_count
The number of lights to enable.

enable
An array of lights to enable.

disable_count
The number of lights to disable.

disable
An array of lights to disable.

Returns

None.

Description

Invoke PEXOCCSetLightSourceState to create an attribute output command which modifies the light source state attribute in the renderer's pipeline state.

If the pipeline's state surface reflection model or back-facing surface reflection model is any value other than PEXRMNone, then lighting is enabled. The light source state maintains a list of indices into the renderer's light table, each of which defines a light, to define which lights are on.

Each element in the enable list activates the light represented by the corresponding light table entry and each element in the disable list deactivates the light represented by the corresponding light table entry.

If you list a light in both the enable list (enable) and the disable list (disable), or specify a light index of zero, then the implementation issues a BadPEXOutputCommand error. If any light in the enable or disable list references an undefined light table entry, then the implementation ignores the light. If you enable more non-ambient lights than the maximum number supported by the implementation in reflectance calculations, then which lights are used is implementation-dependent. Inquire the maximum number of non-ambient lights by invoking the PEXGetImpDepConstants function.

This function is a member of the general surface attribute set.

Errors

BadPEXOutputCommand
The output command contains an invalid value.

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For an overview and for a list of output attribute functions, see Output Attribute Functions.