Table of Contents

Interface CustomEffect

Namespace
SharpDX.Direct2D1
Assembly
SharpDX.Direct2D1.dll

Custom Effect interface. Equivalent of C++ ID2D1EffectImpl.

[Guid("a248fd3f-3e6c-4e63-9f03-7f68ecc91db9")]
public interface CustomEffect : IUnknown, ICallbackable, IDisposable
Inherited Members

Methods

Initialize(EffectContext, TransformGraph)

Creates any resources used repeatedly during subsequent rendering calls.

void Initialize(EffectContext effectContext, TransformGraph transformGraph)

Parameters

effectContext EffectContext

An internal factory interface that creates and returns effect author centric types.

transformGraph TransformGraph

No documentation.

Remarks

This moves resource creation cost to the CreateEffect call, rather than during rendering.If the implementation fails this call, the corresponding SharpDX.Direct2D1.DeviceContext.CreateEffect(System.Guid,SharpDX.Direct2D1.Effect) call also fails.The following example shows an effect implementing an initialize method.

PrepareForRender(ChangeType)

Prepares an effect for the rendering process.

void PrepareForRender(ChangeType changeType)

Parameters

changeType ChangeType

Indicates the type of change the effect should expect.

Remarks

This method is called by the renderer when the effect is within an effect graph that is drawn.The method will be called:If the effect has been initialized but has not previously been drawn. If an effect property has been set since the last draw call. If the context state has changed since the effect was last drawn.The method will not otherwise be called. The transforms created by the effect will be called to handle their input and output rectangles for every draw call.Most effects defer creating any resources or specifying a topology until this call is made. They store their properties and map them to a concrete set of rendering techniques when first drawn.

SetGraph(TransformGraph)

The renderer calls this method to provide the effect implementation with a way to specify its transform graph and transform graph changes. The renderer calls this method when: 1) When the effect is first initialized. 2) If the number of inputs to the effect changes.

void SetGraph(TransformGraph transformGraph)

Parameters

transformGraph TransformGraph

The graph to which the effect describes its transform topology through the SetDescription call..