Skip to main content
XNA Game Studio 4.0 Refresh
Effect.CurrentTechnique Property
Gets or sets the active technique.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework.Graphics (in microsoft.xna.framework.graphics.dll)

Syntax
public EffectTechnique CurrentTechnique { get; set; }

Property Value

The current technique.
Exceptions
Exception typeCondition
ArgumentNullException

CurrentTechnique is null. CurrentTechnique cannot be null.

Remarks

If there are multiple techiques in an effect and you want to use a new technique in the next pass, you must set CurrentTechnique to the new technique before making the rendering pass.

Bb196054.note(en-us,XNAGameStudio.41).gifNote
The BasicEffect class, which is derived from Effect and inherits the Techniques collection, contains only one available technique to set as the active technique. The active technique applies the settings that have been set as the properties of the BasicEffect.
Example
effect.CurrentTechnique = effect.Techniques["TransformTechnique"];
Platforms
Xbox 360, Windows 7, Windows Vista, Windows XP