Name
cgGetParameterBufferOffset - get a parameter's buffer offset
Synopsis
#include <Cg/cg.h>
int cgGetParameterBufferOffset( CGparameter param );
Parameters
- param
-
The parameter for which the buffer offset will be retrieved.
Return Values
Returns the buffer offset for param.
Returns -1 if param does not belong to a buffer or an error occurs.
Description
cgGetParameterBufferOffset returns the buffer offset associated with a
parameter. If param does not belong to a buffer, then -1 is returned.
If the program to which param belongs is in an uncompiled state, it
will be compiled by cgGetParameterBufferOffset. See
cgSetAutoCompile for more information about
program compile states.
Examples
int offset = cgGetParameterBufferOffset( myParam );
Errors
CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.
History
cgGetParameterBufferOffset was introduced in Cg 2.0.
See Also
cgSetProgramBuffer,
cgGetParameterBufferIndex,
cgGetParameterResourceSize,
cgSetAutoCompile
|