Name
cgUpdateProgramParameters - update the 3D API state for deferred parameters
Synopsis
#include <Cg/cg.h>
void cgUpdateProgramParameters( CGprogram program );
Parameters
- program
-
The program for which deferred parameters will be sent to
the corresponding 3D API parameters.
Return Values
None.
Description
cgUpdateProgramParameters performs the appropriate 3D API commands to
set the 3D API resources for all of program's parameters that are marked
update deferred and clears the update deferred state of these parameters.
cgUpdateProgramParameters does nothing when none of program's parameters
are marked update deferred.
cgUpdateProgramParameters assumes the specified program has already been
bound using the appropriate 3D API commands. Results are undefined if the
program is not actually bound by the 3D API when cgUpdateProgramParameters
is called, with the likely result being that the 3D API state for program's
parameters will be mis-loaded.
Examples
/* assumes cgGetProgramContext(program) == context */
if (cgGetParameterSettingMode(context) == CG_DEFERRED_PARAMETER_SETTING) {
cgUpdateProgramParameters(program);
}
Errors
CG_INVALID_PROGRAM_HANDLE_ERROR is generated if program
is not a valid program handle.
History
cgUpdateProgramParameters was introduced in Cg 2.0.
See Also
cgSetParameterSettingMode,
cgGetParameterSettingMode,
cgUpdatePassParameters,
cgSetParameter,
cgGLBindProgram,
cgD3D9BindProgram
|