NAME

cgGLSetParameter - sets the value of scalar and vector parameters

SYNOPSIS

  #include <Cg/cgGL.h>

  /* type is either float or double */

  void cgGLSetParameter1{fd}(CGparameter param,
                             type x);

  void cgGLSetParameter2{fd}(CGparameter param,
                             type x,
			     type y);

  void cgGLSetParameter3{fd}(CGparameter param,
                             type x,
			     type y,
			     type z);

  void cgGLSetParameter4{fd}(CGparameter param,
                             type x,
			     type y,
			     type z,
			     type w);

  void cgGLSetParameter{1234}{fd}v(CGparameter param,
                                   const type *v);

PARAMETERS

param

Specifies the parameter that will be set.

x, y, z, and w

The values to set the parameter to.

v

The values to set the parameter to for the array versions of the set functions.

DESCRIPTION

The cgGLSetParameter functions set the value of a given scalar or vector parameter. The functions are available in various combinations.

Each function takes either 1, 2, 3, or 4 values depending on the function that is used. If more values are passed in than the parameter requires, the extra values will be ignored. If less values are passed in than the parameter requires, the last value will be smeared.

There are versions of each function that take either float or double values signified by the f or d in the function name.

The functions with the v at the end of their names take an array of values instead of explicit parameters.

The cgGLSetParameter functions may be called with either uniform or varying parameters. When called with a varying parameter, the appropriate immediate mode OpenGL entry point will be called. However, cgGLGetParameter will only work with uniform parameters.

RETURN VALUES

The cgGLSetParameter functions do not return any values.

ERRORS

CG_INVALID_PROFILE_ERROR is generated if param's profile is not a supported OpenGL profile.

CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter handle.

CG_INVALID_PARAMETER_ERROR is generated if the parameter fails to set for any other reason.

SEE ALSO

the "cgGLGetParameter" document, the "cgGLSetParameterArray" document, the "cgGLSetMatrixParameter" document, the "cgGLSetMatrixParameterArray" document, the "cgGLSetTextureParameter" document, the "cgGLSetTextureParameterArray" document, and the "cgGLBindProgram" document