cgIsParameterUsed(3)

NAME
cgIsParameterUsed - determine if a parameter is potentially used

SYNOPSIS
  #include <Cg/cg.h>
  CGbool cgIsParameterUsed( CGparameter param,
                            CGhandle container );

PARAMETERS
The parameter to check. Specifies the CGeffect, CGtechnique, CGpass, CGstateassignment, or CGprogram that may potentially use param.

RETURN VALUES
Returns CG_TRUE if param is potentially used by container.

Returns CG_FALSE otherwise.

DESCRIPTION
cgIsParameterUsed returns CG_TRUE if param is potentially used by the given container. If param is a struct or array, CG_TRUE is returned if any of its children are potentially used by container. It otherwise returns CG_FALSE.

The value returned by cgIsParameterUsed is conservative, but not always exact. A return value of CG_TRUE indicates that the parameter may be used by container. A return value of CG_FALSE indicates that the parameter is definintely not used by container.

The given param handle may reference a program parameter, an effect parameter, or a shared parameter.

The container handle may reference a CGeffect, CGtechnique, CGpass, CGstateassignment, or CGprogram.

If container is a CGprogram, CG_TRUE is returned if any of the program's referenced parameters inherit their values directly or indirectly (due to parameter connections) from param.

If container is a CGstateassignment, CG_TRUE is returned if the right-hand side of the state assignment may directly or indirectly depend on the value of param. If the state assignment involves a CGprogram, the program's parameters are also considered, as above.

If container is a CGpass, CG_TRUE is returned if any of the pass' state assignments potentially use param.

If container is a CGtechnique, CG_TRUE is returned if any of the technqiue's passes potentially use param.

If container is a CGeffect, CG_TRUE is returned if any of the effect's techniques potentially use param.

EXAMPLES
to-be-written

ERRORS
CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter, or if container is not the handle of a valid container.

HISTORY
cgIsParameterUsed was introduced in Cg 1.4.

SEE ALSO
cgIsParameterReferenced, cgConnectParameter