MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Cg Core Runtime API                             cgSetParameter(3)



NAME
     cgSetParameter - sets the value of scalar and vector
     parameters

SYNOPSIS
       #include 

       /* TYPE is int, float or double */

       void cgSetParameter1{ifd}( CGparameter param,
                                  TYPE x );

       void cgSetParameter2{ifd}( CGparameter param,
                                  TYPE x,
                                  TYPE y );

       void cgSetParameter3{ifd}( CGparameter param,
                                  TYPE x,
                                  TYPE y,
                                  TYPE z );

       void cgSetParameter4{ifd}( CGparameter param,
                                  TYPE x,
                                  TYPE y,
                                  TYPE z,
                                  TYPE w );

       void cgSetParameter{1234}{ifd}v( CGparameter param,
                                        const TYPE * v );


PARAMETERS
     param   The parameter that will be set.

     x, y, z, and w
             The values to which to set the parameter.

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

RETURN VALUES
     None.

DESCRIPTION
     The cgSetParameter 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.



Cg Toolkit 2.1            Last change:                          1






Cg Core Runtime API                             cgSetParameter(3)



     There are versions of each function that take int, float or
     double values signified by the i, 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.

     Once cgSetParameter has been used to set a parameter, the
     values may be retrieved from the parameter using the
     CGCURENT enumerant with cgGetParameterValues.

     If an API-dependant layer of the Cg runtime (e.g. cgGL) is
     used, these entry points may end up making API (e.g. OpenGL)
     calls.

     Note:::: Previous releases of Cg allowed you to store more
     values in a parameter than indicated by the parameter's
     type. For example, one could use cgGLSetParameter4f to store
     four values into a parameter of type CGFLOAT (not
     CGFLOAT4). All four values could later be retrieved using a
     get call which requested more than one value.     However,
     this feature conflicts with the GLSL approach and also leads
     to issues with      parameters mapped into BUFERS.
     Therefore, beginning with Cg 2.0 any components beyond
     the number indicated by the parameter type are ignored.

EXAMPLES
     to-be-written

ERORS
     CGINVALIDPARAMHANDLEROR is generated if param is not a
     valid parameter.

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

HISTORY
     The d and f versions of cgSetParameter were introduced in Cg
     1.2.

     The i versions of cgSetParameter were introduced in Cg 1.4.

SEE ALSO
     cgGetParameterValue











Cg Toolkit 2.1            Last change:                          2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™