UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:d2d1effectauthor.ID2D1EffectImpl.PrepareForRender |
ID2D1EffectImpl::PrepareForRender (d2d1effectauthor.h) |
Prepares an effect for the rendering process. |
|
direct2d\id2d1effectimpl_prepareforrender.htm |
Direct2D |
0EBA4FDB-A9EA-4FCF-BF40-3D73ED356CD4 |
12/05/2018 |
ID2D1EffectImpl interface [Direct2D],PrepareForRender method, ID2D1EffectImpl.PrepareForRender, ID2D1EffectImpl::PrepareForRender, PrepareForRender, PrepareForRender method [Direct2D], PrepareForRender method [Direct2D],ID2D1EffectImpl interface, d2d1effectauthor/ID2D1EffectImpl::PrepareForRender, direct2d.id2d1effectimpl_prepareforrender |
d2d1effectauthor.h |
Windows |
Windows 8 and Platform Update for Windows 7 [desktop apps \| UWP apps] |
Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps \| UWP apps] |
D2D1.lib |
Windows |
19H1 |
|
|
|
|
|
|
Prepares an effect for the rendering process.
Type: D2D1_CHANGE_TYPE
Indicates the type of change the effect should expect.
Type: HRESULT
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
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.
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.
An effect normally waits until it is rendered before snapping its current state and applying it to any transforms it has encapsulated.
class CMyTransform : public ID2D1DrawTransform
{
public:
// Transform methods omitted.
HRESULT PrepareForRender(FLOAT radius);
};
class CEffectImplementation : public ID2D1EffectImpl
{
public:
void SetRadius(FLOAT radius) { _radius = radius; }
IFACEMETHODIMP PrepareForRender(D2D1_CHANGE_TYPE /*type*/)
{
// Send the radius to the transform and ask it to render.
return _pMyTransform->PrepareForRender(_radius);
}
private:
CMyTransform *_pMyTransform;
FLOAT _radius;
};