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

> ## Name

> cgGetFirstTechnique - get the first technique in an effect

> ## Synopsis

>     #include <Cg/cg.h>

>     CGtechnique cgGetFirstTechnique( CGeffect effect );

> ## Parameters

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

> ## Return Values

> Returns the first CGtechnique object in effect.

> Returns NULL if effect contains no techniques or an error occurs.

> ## Description

> cgGetFirstTechnique is used to begin iteration over all of the techniques contained within a effect. See cgGetNextTechnique for more information.

> ## Examples

> Iterating through the techniques in an effect:

>     CGeffect effect = cgCreateEffectFromFile(context, cgfx_filename, NULL);
>     CGtechnique technique = cgGetFirstTechnique(effect);
>     while (technique) {
>       // Do something with each technique
>       technique = cgGetNextTechnique(technique);
>     }

> ## Errors

> CG_INVALID_EFFECT_HANDLE_ERROR is generated if effect is not a valid effect.

> ## History

> cgGetFirstTechnique was introduced in Cg 1.4.

> ## See Also

> cgGetFirstTechniqueAnnotation, cgGetNamedTechniqueAnnotation, cgGetNextTechnique, cgGetNamedTechnique, cgValidateTechnique, cgGetPassTechnique, cgGetTechniqueEffect, cgGetTechniqueName, cgIsTechnique