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(
  const D2D1_VERTEX_BUFFER_PROPERTIES        *vertexBufferProperties,
  const GUID                                 *resourceId,
  const D2D1_CUSTOM_VERTEX_BUFFER_PROPERTIES *customVertexBufferProperties,
  ID2D1VertexBuffer                          **buffer
);

Parameters

vertexBufferProperties

Type: const D2D1_VERTEX_BUFFER_PROPERTIES*

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

resourceId

Type: const GUID*

The unique id that identifies the vertex buffer.

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.

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

   
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