Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID2D1DrawInfo::SetVertexProcessing method

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 = NULL,
  [in, optional] const D2D1_VERTEX_RANGE      *vertexRange = NULL,
                       GUID                   *vertexShader
);

Parameters

vertexBuffer [in, optional]

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.

blendDescription [in, optional]

Type: const D2D1_BLEND_DESCRIPTION*

How the vertices will be blended with the output texture.

vertexRange [in, optional]

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

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1effectauthor.h

Library

D2d1.lib

See also

ID2D1DrawInfo
ID2D1EffectContext::CreateVertexBuffer
ID2D1EffectContext::LoadVertexShader

 

 

Show:
© 2017 Microsoft