D3DX10CreateSprite function
Create a sprite for drawing a 2D texture.
Note
Instead of using this function, we recommend that you use Direct2D and the DirectXTK library, SpriteBatch class.
Syntax
HRESULT D3DX10CreateSprite(
_In_ ID3D10Device *pDevice,
_In_ UINT cDeviceBufferSize,
_Out_ LPD3DX10SPRITE *ppSprite
);
Parameters
-
pDevice [in]
-
Type: ID3D10Device*
A pointer to the device (see ID3D10Device Interface) that will draw the sprite.
-
cDeviceBufferSize [in]
-
Type: UINT
The size of the vertex buffer, in number of sprites, that will be sent to the device when ID3DX10Sprite::Flush or ID3DX10Sprite::DrawSpritesImmediate is called. This should be a small number if you know you will be rendering a small number of sprites at a time (to save memory) and a large number if you know you will be rendering a large number of sprites at a time. The maximum value is 4096. If 0 is specified, the vertex buffer size will automatically be set to 4096.
-
ppSprite [out]
-
Type: LPD3DX10SPRITE*
The address of a pointer to a sprite interface (see ID3DX10Sprite Interface).
Return value
Type: HRESULT
If the function succeeds, the return value is S_OK. If the function fails, the return value can be one of the following: D3DERR_INVALIDCALL, E_OUTOFMEMORY.
Requirements
Requirement | Value |
---|---|
Header |
|
Library |
|
See also