Click or drag to resize
DigitalRuneEffectParameterArrayBindingT Class
Binds an effect parameter to an array of values of a given type.
Inheritance Hierarchy

Namespace: DigitalRune.Graphics.Effects
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public abstract class EffectParameterArrayBinding<T> : EffectParameterBinding

Type Parameters

T
The value type. Must be one of the following types: Boolean, Int32, Matrix, Quaternion, Single, Vector2, Vector3, Vector4,

The EffectParameterArrayBindingT type exposes the following members.

Constructors
  NameDescription
Protected methodEffectParameterArrayBindingT
Initializes a new instance of the EffectParameterArrayBindingT class. (This constructor creates an uninitialized instance. Use this constructor only for cloning or other special cases!)
Protected methodEffectParameterArrayBindingT(Effect, EffectParameter)
Initializes a new instance of the EffectParameterArrayBindingT class.
Protected methodEffectParameterArrayBindingT(Effect, EffectParameter, T)
Initializes a new instance of the EffectParameterArrayBindingT class with the given value.
Protected methodEffectParameterArrayBindingT(Effect, EffectParameter, T)
Initializes a new instance of the EffectParameterArrayBindingT class with the given array of values.
Top
Methods
  NameDescription
Public methodApply
Applies the value to the effect parameter.
(Inherited from EffectParameterBinding.)
Public methodClone
Creates a new EffectParameterBinding that is a clone of the current instance.
(Inherited from EffectParameterBinding.)
Protected methodCloneCore
Makes the instance a clone (deep copy) of the specified EffectParameterBinding.
(Overrides EffectParameterBindingCloneCore(EffectParameterBinding).)
Protected methodCreateInstanceCore
When implemented in a derived class, creates a new instance of the EffectParameterBinding derived class.
(Inherited from EffectParameterBinding.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnApply
Called when the effect parameter needs to be applied.
(Overrides EffectParameterBindingOnApply(RenderContext).)
Protected methodOnUpdate
Called when the effect parameter value needs to be updated.
(Overrides EffectParameterBindingOnUpdate(RenderContext).)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Updates the value of the binding.
(Inherited from EffectParameterBinding.)
Top
Properties
  NameDescription
Public propertyDescription
Gets the description of the effect parameter.
(Inherited from EffectParameterBinding.)
Public propertyParameter
Gets the effect parameter.
(Inherited from EffectParameterBinding.)
Public propertyValues
Gets (or sets) the values of the effect parameter.
Top
Remarks

EffectParameterBindingT and EffectParameterArrayBindingT are the base implementations of all parameter bindings of type T. Classes derived from EffectParameterBindingT are used to bind effect parameters that represent a single value (such as Single, Vector3, etc.). Classes that are derived from EffectParameterArrayBindingT are used to bind effect parameters that represent arrays of values.

ConstParameterBindingT and ConstParameterArrayBindingT should be used when the value of the effect parameter is static or updated manually. The value can be set directly. The binding ensures that the parameter is applied whenever the Effect needs to be rendered.

DelegateParameterBindingT and DelegateParameterArrayBindingT need to be used when the value of the effect parameter is dynamic and should be updated automatically.

NullParameterBindingT and NullParameterArrayBindingT are dummy bindings that do not modify effect parameters. These bindings can be set, if parameters should not be updated automatically.

User-defined bindings can be implemented by deriving from EffectParameterBinding, EffectParameterBindingT, or EffectParameterArrayBindingT to define new mechanisms for resolving effect parameter values.

Notes to Inheritors:
The static constructors of EffectParameterBindingT and EffectParameterArrayBindingT automatically validate the value type T and checks whether the type is supported.

Inheritors should override OnUpdate(RenderContext) when the value of the effect parameter needs to be updated before rendering. The new value computed in OnUpdate(RenderContext) must be stored in Value. (It is not necessary to call OnUpdate(RenderContext) of the base class in the derived class.)

By default, OnApply(RenderContext) assigns the current Value to Parameter by using the appropriate EffectParameter.SetValue() method. Inheritors can override this method to perform additional work. It is necessary to call OnApply(RenderContext) of the base class to ensure that the value is properly set.

See Also