ID3DXSprite

The ID3DXSprite interface provides a set of methods that simplify the process of drawing sprites using Microsoft Direct3D.

ID3DXSprite Members

Method Description
ID3DXSprite::Begin Prepares a device for drawing sprites.
ID3DXSprite::Draw Adds a sprite to the list of batched sprites.
ID3DXSprite::End Calls ID3DXSprite::Flush and restores the device state to how it was before ID3DXSprite::Begin was called.
ID3DXSprite::Flush Forces all batched sprites to be submitted to the device. Device states remain as they were after the last call to ID3DXSprite::Begin. The list of batched sprites is then cleared.
ID3DXSprite::GetDevice Retrieves the device associated with the sprite object.
ID3DXSprite::GetTransform Gets the sprite transform.
ID3DXSprite::OnLostDevice Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost or before resetting a device.
ID3DXSprite::OnResetDevice Use this method to re-acquire resources and save initial state.
ID3DXSprite::SetTransform Sets the sprite transform.
ID3DXSprite::SetWorldViewLH Sets the left-handed world-view transform for a sprite. A call to this method is required before billboarding or sorting sprites.
ID3DXSprite::SetWorldViewRH Sets the right-handed world-view transform for a sprite. A call to this method is required before billboarding or sorting sprites.

Remarks

The ID3DXSprite interface is obtained by calling the D3DXCreateSprite function.

The application typically first calls ID3DXSprite::Begin, which allows control over the device render state, alpha blending, and sprite transformation and sorting. Then for each sprite to be displayed, call ID3DXSprite::Draw. ID3DXSprite::Draw can be called repeatedly to store any number of sprites. To display the batched sprites to the device, call ID3DXSprite::End or ID3DXSprite::Flush.

The LPD3DXSPRITE type is defined as a pointer to the ID3DXSprite interface.

typedef interface ID3DXSprite ID3DXSprite;
typedef interface ID3DXSprite *LPD3DXSPRITE;

Requirements

Header: Declared in D3dx9core.h.

Import Library: Use D3dx9.lib.