NAME

cgCreateSamplerState - create a sampler state definition

SYNOPSIS

  #include <Cg/cg.h>

  CGstate cgCreateSamplerState( CGcontext context,
                                const char * name,
                                CGtype type );

PARAMETERS

context

The context to define the sampler state in.

name

The name of the new sampler state.

type

The type of the new sampler state.

RETURN VALUES

cgCreateSamplerState returns a handle to the newly created CGstate. If there is an error, NULL is returned.

DESCRIPTION

cgCreateSamplerState adds a new sampler state definition to the context. When an effect file is added to the context, all state in sampler_state blocks in must have been defined ahead of time via a call to cgCreateSamplerState or cgCreateArraySamplerState.

Applications will typically call cgSetStateCallbacks shortly after creating a new state with cgCreateSamplerState.

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. (Array-typed state should be created with cgCreateArrayState.)

HISTORY

cgCreateSamplerState was introduced in Cg 1.4.

SEE ALSO

cgCreateArraySamplerState, cgGetStateName, cgGetStateType, cgIsState, cgCreateSamplerStateAssignment, cgGLRegisterStates