> # NAME

> cgGetNamedEffect - get an effect from a context by name

> # SYNOPSIS

>       #include <Cg/cg.h>

>       CGeffect cgGetNamedEffect( CGcontext context,
>                                  const char * name );

> # PARAMETERS

> context

>   The context from which to retrieve the effect.

> name

>   The name of the effect to retrieve.

> # RETURN VALUES

> Returns the named effect if found.

> Returns NULL if context has no effect corresponding to name or if an error occurs.

> # DESCRIPTION

> The effects in a context can be retrieved directly by name using cgGetNamedEffect. The effect names can be discovered by iterating through the context's effects (see cgGetFirstEffect and cgGetNextEffect) and calling cgGetEffectName for each.

> # EXAMPLES

>       /* get "simpleEffect" from context */
>       CGeffect effect = cgGetNamedEffect( context, "simpleEffect" );

> # ERRORS

> CG_INVALID_CONTEXT_HANDLE_ERROR is generated if context is not a valid context.

> # HISTORY

> cgGetNamedEffect was introduced in Cg 1.5.

> # SEE ALSO

> cgGetEffectName, cgSetEffectName, cgGetFirstEffect, cgGetNextEffect