Class Effect
Used to set and query shader effects, and to choose techniques.
public class Effect : GraphicsResource, IDisposable
- Inheritance
-
Effect
- Implements
- Derived
- Inherited Members
Constructors
Effect(Effect)
Creates a clone of the Effect.
protected Effect(Effect cloneSource)
Parameters
Effect(GraphicsDevice, byte[])
Creates a new instance of Effect.
public Effect(GraphicsDevice graphicsDevice, byte[] effectCode)
Parameters
graphicsDevice
GraphicsDeviceGraphics device
effectCode
byte[]The effect code.
Exceptions
- ArgumentException
This
effectCode
is invalid.
Effect(GraphicsDevice, byte[], int, int)
Creates a new instance of Effect.
public Effect(GraphicsDevice graphicsDevice, byte[] effectCode, int index, int count)
Parameters
graphicsDevice
GraphicsDeviceGraphics device
effectCode
byte[]The effect code.
index
intcount
int
Exceptions
- ArgumentException
This
effectCode
is invalid.
Properties
CurrentTechnique
Gets or sets the active technique.
public EffectTechnique CurrentTechnique { get; set; }
Property Value
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.
Parameters
Gets a collection of shader parameters used for this effect.
public EffectParameterCollection Parameters { get; }
Property Value
Techniques
Gets a collection of shader techniques that are defined for this effect.
public EffectTechniqueCollection Techniques { get; }
Property Value
Methods
Clone()
Returns a deep copy of the effect where immutable types are shared and mutable data is duplicated.
public virtual Effect Clone()
Returns
- Effect
The cloned effect.
Remarks
See "Cloning an Effect" in MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476138(v=vs.85).aspx
Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected override void Dispose(bool disposing)
Parameters
disposing
bool
GraphicsDeviceResetting()
The GraphicsDevice is resetting, so GPU resources must be recreated.
protected override void GraphicsDeviceResetting()
OnApply()
Applies the effect state just prior to rendering the effect.
protected virtual void OnApply()