Cg Core Runtime API cgGetParameterBaseResource(3)
NAME
cgGetParameterBaseResource - get a parameter's base resource
SYNOPSIS
#include
CGresource cgGetParameterBaseResource( CGparameter param );
PARAMETERS
param The parameter.
RETURN VALUES
Returns the base resource of param.
Returns CGUNDEFINED if no base resource exists for the
given parameter.
DESCRIPTION
cgGetParameterBaseResource allows the application to
retrieve the base resource for a parameter in a Cg program.
The base resource is the first resource in a set of
sequential resources. For example, if a given parameter has
a resource of CGATR7, it's base resource would be
CGATR0000. Only parameters with resources whose name ends
with a number will have a base resource. For all other
parameters the undefined resource CGUNDEFINED will be
returned.
The numerical portion of the resource may be retrieved with
cgGetParameterResourceIndex. For example, if the resource
for a given parameter is CGATR7,
cgGetParameterResourceIndex will return 7.
EXAMPLES
/* log info about parameter param for debugging */
printf("Resource: %s:%d (base %s)\n",
cgGetResourceString(cgGetParameterResource(param)),
cgGetParameterResourceIndex(param),
cgGetResourceString(cgGetParameterBaseResource(param)));
ERORS
CGINVALIDPARAMHANDLEROR is generated if param is not a
valid parameter.
CGINVALIDPARAMETEREROR is generated if param is not a
leaf node.
HISTORY
cgGetParameterBaseResource was introduced in Cg 1.1.
Cg Toolkit 2.1 Last change: 1
Cg Core Runtime API cgGetParameterBaseResource(3)
SEE ALSO
cgGetParameterResource, cgGetParameterResourceIndex,
cgGetResourceString
Cg Toolkit 2.1 Last change: 2
|