cgSetParameterValuefc

Langue: en

Version: 47147 (openSuse - 09/10/07)

Section: 3 (Bibliothèques de fonctions)

NAME

cgSetParameterValuefc - set the value of any numeric parameter

SYNOPSIS


  #include <Cg/cg.h>






  void cgSetParameterValuefc( CGparameter param, 

                              int nelements,

                              const float * v );





PARAMETERS


param
The program parameter whose value will be set.
nelements
The number of elements in array v.
v
Source buffer from which the parameter values will be read.

RETURN VALUES

None.

DESCRIPTION

cgSetParameterValuefc allows the application to set the value of any numeric parameter or parameter array.

The given parameter must be a scalar, vector, matrix, or a (possibly multidimensional) array of scalars, vectors, or matrices.

Any matrices referenced by param to be initialized in column-major order.

If v is smaller than the total number of values in the given source parameter, CG_NOT_ENOUGH_DATA_ERROR is generated.

The total number of values in a parameter, ntotal, may be computed as follow:


    int nrows = cgGetParameterRows(param);

    int ncols = cgGetParameterColumns(param);

    int asize = cgGetArrayTotalSize(param);

    int ntotal = nrows*ncols;

    if (asize > 0) ntotal *= asize;





EXAMPLES

to-be-written

ERRORS

CG_INVALID_PARAM_HANDLE_ERROR is generated if param is not a valid parameter.

CG_INVALID_PARAMETER_ERROR is generated if param is a varying input to a fragment program.

CG_INVALID_POINTER_ERROR is generated if v is NULL.

CG_NOT_ENOUGH_DATA_ERROR is generated if nelements is less than the total size of param.

CG_NON_NUMERIC_PARAMETER_ERROR is generated if param is of a non-numeric type.

HISTORY

cgSetParameterValuefc was introduced in Cg 1.4.

SEE ALSO

the cgSetParameterValue manpage, the cgGetParameterRows manpage, the cgGetParameterColumns manpage, the cgGetArrayTotalSize manpage, the cgGetParameterValue manpage