EffectParameterBindingT Class |
Namespace: DigitalRune.Graphics.Effects
The EffectParameterBindingT type exposes the following members.
Name | Description | |
---|---|---|
EffectParameterBindingT |
Initializes a new instance of the EffectParameterBindingT class.
(This constructor creates an uninitialized instance. Use this constructor only for cloning
or other special cases!)
| |
EffectParameterBindingT(Effect, EffectParameter) |
Initializes a new instance of the EffectParameterBindingT class.
| |
EffectParameterBindingT(Effect, EffectParameter, T) |
Initializes a new instance of the EffectParameterBinding class with the given
value.
|
Name | Description | |
---|---|---|
Apply |
Applies the value to the effect parameter.
(Inherited from EffectParameterBinding.) | |
Clone |
Creates a new EffectParameterBinding that is a clone of the current instance.
(Inherited from EffectParameterBinding.) | |
CloneCore |
Makes the instance a clone (deep copy) of the specified
EffectParameterBinding.
(Overrides EffectParameterBindingCloneCore(EffectParameterBinding).) | |
CreateInstanceCore |
When implemented in a derived class, creates a new instance of the
EffectParameterBinding derived class.
(Inherited from EffectParameterBinding.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnApply |
Called when the effect parameter value needs to be applied.
(Overrides EffectParameterBindingOnApply(RenderContext).) | |
OnUpdate |
Called when the effect parameter value needs to be updated.
(Overrides EffectParameterBindingOnUpdate(RenderContext).) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Update |
Updates the value of the binding.
(Inherited from EffectParameterBinding.) |
Name | Description | |
---|---|---|
Description |
Gets the description of the effect parameter.
(Inherited from EffectParameterBinding.) | |
Parameter |
Gets the effect parameter.
(Inherited from EffectParameterBinding.) | |
Value |
Gets (or sets) the value of the effect parameter.
|
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.