Microsoft DirectX 9.0

D3DXCreateSprite Function

Creates a sprite object which is associated with a particular device. Sprite objects are used to draw 2-D images to the screen.


HRESULT D3DXCreateSprite(      

    LPDIRECT3DDEVICE9 pDevice,     LPD3DXSPRITE *ppSprite );


[in] Pointer to an IDirect3DDevice9 interface, the device to be associated with the sprite.
[out] Address of a pointer to an ID3DXSprite interface. This interface allows the user to access sprite functions.

Return Value

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be one of the following values.

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.
E_OUTOFMEMORYMicrosoft?Direct3D?could not allocate sufficient memory to complete the call.


This interface can be used to draw two dimensional images in screen space of the associated device.

Function Information

Import libraryd3dx9.lib
Minimum operating systems Windows 98

© 2002 Microsoft Corporation. All rights reserved.