ID2D1EffectContext::CreateVertexBuffer method (d2d1effectauthor.h)

Creates a vertex buffer or finds a standard vertex buffer and optionally initializes it with vertices. The returned buffer can be specified in the render info to specify both a vertex shader and or to pass custom vertices to the standard vertex shader used by Direct2D.

Syntax

HRESULT CreateVertexBuffer(
  [in]           const D2D1_VERTEX_BUFFER_PROPERTIES        *vertexBufferProperties,
  [in, optional] const GUID                                 *resourceId,
  [in, optional] const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES *customVertexBufferProperties,
  [out]          ID2D1VertexBuffer                          **buffer
);

Parameters

[in] vertexBufferProperties

Type: const D2D1_VERTEX_BUFFER_PROPERTIES*

The properties used to describe the vertex buffer and vertex shader.

[in, optional] resourceId

Type: const GUID*

The unique id that identifies the vertex buffer.

[in, optional] customVertexBufferProperties

Type: const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES*

The properties used to define a custom vertex buffer. If you use a built-in vertex shader, you don't have to specify this property.

[out] buffer

Type: ID2D1VertexBuffer**

The returned vertex buffer.

Return value

Type: HRESULT

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

HRESULT Description
S_OK No error occurred.
E_OUTOFMEMORY Direct2D could not allocate sufficient memory to complete the call.
E_INVALIDARG An invalid parameter was passed to the returning function.

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

See also

ID2D1EffectContext