NAME

cgGetStateContext - get a state's context

SYNOPSIS

  #include <Cg/cg.h>

  CGcontext cgGetStateContext( CGstate state );

PARAMETERS

state

The state.

RETURN VALUES

Returns the context to which state belongs.

Returns NULL if an error occurs.

DESCRIPTION

cgGetStateContext allows the application to retrieve the context of a state. This is the context used to create the state with cgCreateState.

EXAMPLES

  CGcontext context = cgCreateContext();
  CGstate state = cgCreateState(context, "GreatStateOfTexas", CG_FLOAT);
  assert(context == cgGetStateContext(state));

ERRORS

CG_INVALID_STATE_HANDLE_ERROR is generated if state is not a valid state.

HISTORY

cgGetStateContext was introduced in Cg 1.5.

SEE ALSO

cgCreateState, cgCreateArrayState, cgGetEffectContext, cgGetParameterContext, cgGetProgramContext