cgGetFirstEffect
Keywords: cgGetFirstEffect, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> cgGetFirstEffect - get the first effect in a context

> ## Synopsis

>     #include <Cg/cg.h>

>     CGeffect cgGetFirstEffect( CGcontext context );

> ## Parameters

> context
>   The context from which to retrieve the first effect.

> ## Return Values

> Returns the first CGeffect object in context.

> Returns NULL if context contains no effects.

> ## Description

> cgGetFirstEffect is used to begin iteration over all of the effects contained by a context. See cgGetNextEffect for more information.

> ## Examples

>     /* one or more effects have previously been loaded into context */
>     CGeffect effect = cgGetFirstEffect( context );

> ## Errors

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

> ## History

> cgGetFirstEffect was introduced in Cg 1.4.

> ## See Also

> cgGetNextEffect, cgCreateEffect, cgCreateEffectFromFile, cgDestroyEffect, cgIsEffect, cgGetFirstProgram