cgGetNumStateEnumerants(3)

NAME
cgGetNumStateEnumerants - gets the number of enumerants associated with a state

SYNOPSIS
  #include <Cg/cg.h>

  int cgGetNumStateEnumerants( CGstate state );

PARAMETERS

state
    The state from which to retrieve the number of associated enumerants.

RETURN VALUES
Returns the number of enumerants associated with state.

Returns 0 if an error occurs.

DESCRIPTION
cgGetNumStateEnumerants returns the number of enumerants associated with a given CGstate. Enumerants can be added to a CGstate using cgAddStateEnumerant.

EXAMPLES
    int value;
    char* pName;

    int nEnums = cgGetNumStateEnumerants(state);

    for (ii=0; ii<nEnums; ++ii) {
        pName = cgGetStateEnumerant(state, ii, &value );
        printf("%i: %s %i\n", ii+1, pName, value);
    }

ERRORS
CG_INVALID_STATE_HANDLE_ERROR is generated if state is not a valid state.

HISTORY
cgGetNumStateEnumerants was introduced in Cg 2.2.

SEE ALSO
cgAddStateEnumerant, cgGetStateEnumerant, cgGetStateEnumerantName, cgGetStateEnumerantValue