Name
cgGetEffectParameterBuffer - get the Cg buffer associated to the passed effect parameter.
Synopsis
#include <Cg/cg.h>
CGbuffer cgGetEffectParameterBuffer(CGparameter param);
Parameters
- param
-
The effect parameter associated with a Cg buffer (using the BUFFER semantic) set by cgSetEffectParameterBuffer.
Return Values
Returns the CGbuffer object set by cgSetEffectParameterBuffer.
Returns NULL if param is invalid or does not have a CGbuffer set
by cgSetEffectParameterBuffer.
Description
cgGetEffectParameterBuffer returns the CGbuffer object set by cgSetEffectParameterBuffer.
Examples
In effect:
struct Material
{
float4 ambient;
float4 diffuse;
float4 specular;
float4 shine;
} cbuffer0_Material : BUFFER[0];
In C/C++:
CGbuffer myCgBuffer = cgCreateBuffer(...);
cgSetEffectParameterBuffer(cgGetNamedEffectParameter(myCgEffect, "cbuffer0_Material"), myCgBuffer);
// ...
CGbuffer buffer = cgGetEffectParameterBuffer(cgGetNamedEffectParameter(myCgEffect, "cbuffer0_Material"));
// Now buffer == myCgBuffer
Errors
CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.
History
cgGetEffectParameterBuffer was introduced in Cg 3.0.
See Also
cgSetEffectParameterBuffer
|