NAME
cgCreateArrayState - create an array-typed state definition
SYNOPSIS
#include <Cg/cg.h> CGstate cgCreateArrayState( CGcontext context, const char * name, CGtype type, int nelements );PARAMETERS
- context
The context in which to define the state.
- name
The name of the new state.
- type
The type of the new state.
- nelements
The number of elements in the array.
RETURN VALUES
cgCreateArrayState returns a handle to the newly created CGstate. If there is an error, NULL is returned.
DESCRIPTION
cgCreateArrayState adds a new array-typed state definition to the context. When a CgFX file is later added to the context, all state assignments in passes in the file must have been defined ahead of time via a call to cgCreateState or cgCreateArrayState.
Applications will typically call cgSetStateCallbacks shortly after creating a new state with cgCreateState.
EXAMPLES
to-be-written
ERRORS
CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context does not refer to a valid context.
CG_INVALID_PARAMETER_ERROR is generated if name is NULL or not a valid identifier, as well as if type is not a simple scalar, vector, or matrix-type, or if nelements is not a positive number.
HISTORY
cgCreateArrayState was introduced in Cg 1.4.
SEE ALSO
cgGetStateName, cgGetStateType, cgIsState, cgSetStateCallbacks, cgGLRegisterStates