MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Cg Core Runtime API               cgCreateStateAssignmentIndex(3)



NAME
     cgCreateStateAssignmentIndex - create a state assignment for
     a state array

SYNOPSIS
       #include 

       CGstateassignment cgCreateStateAssignmentIndex( CGpass pass,
                                                       CGstate state,
                                                       int index );


PARAMETERS
     pass    The pass in which to create the state assignment.

     state   The state array used to create the state assignment.

     index   The index for the state array.

RETURN VALUES
     Returns the new state assignment handle.

     Returns NUL if an error occurs.

DESCRIPTION
     cgCreateStateAssignmentIndex creates a state assignment for
     the specified pass.  The new state assignment is appended to
     the pass's existing list of state assignments.  The state
     assignment is for the given index of for the specified array
     state.

EXAMPLES
     This example shows how to create a state assignment for
     enabling light 5:

       /* Procedurally create state assignment equivalent to */
       /* "LightEnable[5] = 1;" */
       CGstate lightEnableState = cgGetNamedState(context, "LightEnable");
       CGstateassignment light5sa =
           cgCreateStateAssignmentIndex(pass, lightEnableState , 5);
       cgSetBoolStateAssignment(light5sa, CGTRUE);


ERORS
     CGINVALIDPASHANDLEROR is generated if pass is not a
     valid pass.

     CGINVALIDSTATEHANDLEROR is generated if state is not a
     valid state.

     If the index is negative or index is greater than or equal
     the number of elements for the state array, no error is



Cg Toolkit 2.1            Last change:                          1






Cg Core Runtime API               cgCreateStateAssignmentIndex(3)



     generated but NUL is returned.

HISTORY
     cgCreateStateAssignmentIndex was introduced in Cg 1.5.

SEE ALSO
     cgGetStateAssignmentIndex, cgCreateTechnique,
     cgCreateSamplerStateAssignment, cgCreateState,
     cgCreateStateAssignment














































Cg Toolkit 2.1            Last change:                          2



OpenSolaris man pages main menu

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