ID2D1DrawInfo::SetVertexProcessing method (d2d1effectauthor.h)
Sets a vertex buffer, a corresponding vertex shader, and options to control how the vertices are to be handled by the Direct2D context.
Syntax
HRESULT SetVertexProcessing(
[in, optional] ID2D1VertexBuffer *vertexBuffer,
D2D1_VERTEX_OPTIONS vertexOptions,
[in, optional] const D2D1_BLEND_DESCRIPTION *blendDescription,
[in, optional] const D2D1_VERTEX_RANGE *vertexRange,
const GUID *vertexShader
);
Parameters
[in, optional] vertexBuffer
Type: ID2D1VertexBuffer*
The vertex buffer, if this is cleared, the default vertex shader and mapping to the transform rectangles will be used.
vertexOptions
Type: D2D1_VERTEX_OPTIONS
Options that influence how the renderer will interact with the vertex shader.
[in, optional] blendDescription
Type: const D2D1_BLEND_DESCRIPTION*
How the vertices will be blended with the output texture.
[in, optional] vertexRange
Type: const D2D1_VERTEX_RANGE*
The set of vertices to use from the buffer.
vertexShader
Type: GUID*
The GUID of the vertex shader.
Return value
Type: HRESULT
If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.
Remarks
The vertex shaders associated with the vertex buffer through the vertex shader GUID must have been loaded through the ID2D1EffectContext::LoadVertexShader method before this call is made.
If you pass the vertex option D2D1_VERTEX_OPTIONS_DO_NOT_CLEAR, then the method fails unless the blend description is exactly this:
D2D1_BLEND_DESCRIPTION blendDesc =
{
D2D1_BLEND_ONE,
D2D1_BLEND_ZERO,
D2D1_BLEND_OPERATION_ADD,
D2D1_BLEND_ONE,
D2D1_BLEND_ZERO,
D2D1_BLEND_OPERATION_ADD,
{ 1.0f, 1.0f, 1.0f, 1.0f }
};
If this call fails, the corresponding ID2D1Effect instance is placed into an error state and fails to draw.
If blendDescription is NULL, a foreground-over blend mode is used.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | d2d1effectauthor.h |
Library | D2d1.lib |