ID3D11Device::CreateBuffer Method
Create a buffer (vertex buffer, index buffer, or shader-constant buffer).
Syntax
HRESULT CreateBuffer(
[in] const D3D11_BUFFER_DESC *pDesc,
[in, optional] const D3D11_SUBRESOURCE_DATA *pInitialData,
[out, optional] ID3D11Buffer **ppBuffer
);
Parameter
pDesc [in]
Typ: const D3D11_BUFFER_DESC*A pointer to a D3D11_BUFFER_DESC structure that describes the buffer.
pInitialData [in, optional]
Typ: const D3D11_SUBRESOURCE_DATA*A pointer to a D3D11_SUBRESOURCE_DATA structure that describes the initialization data; use NULL to allocate space only (with the exception that it cannot be NULL if the usage flag is D3D11_USAGE_IMMUTABLE).
ppBuffer [out, optional]
Typ: ID3D11Buffer**Address of a pointer to the ID3D11Buffer interface for the buffer object created. Set this parameter to NULL to validate the other input parameters (S_FALSE indicates a pass).
Rückgabewert
Typ: HRESULT
This method returns E_OUTOFMEMORY if there is insufficient memory to create the buffer. See Direct3D 11 Return Codes for other possible return values.
Hinweise
For example code, see How to: Create a Vertex Buffer, How to: Create an Index Buffer or How to: Create a Constant Buffer.
Anforderungen
Header |
D3D11.h |
Bibliothek |
D3D11.lib |