ID3DX10Sprite interface

The ID3DX10Sprite interface provides a set of methods that simplify the process of drawing sprites using Microsoft Direct3D. This interface can operate on a set of many sprites.

Members

The ID3DX10Sprite interface inherits from the IUnknown interface. ID3DX10Sprite also has these types of members:

Methods

The ID3DX10Sprite interface has these methods.

Method Description
Begin Prepare a device for drawing sprites.
DrawSpritesBuffered Add an array of sprites to the batch of sprites to be rendered. This must be called in between calls to ID3DX10Sprite::Begin and ID3DX10Sprite::End, and ID3DX10Sprite::Flush must be called before End to send all of the batched sprites to the device for rendering. This draw method is most useful when drawing a small number of sprites that you want buffered into a large batch, such as fonts.
DrawSpritesImmediate Draw an array of sprites. This will immediately send the sprites to the device for rendering, which is different from ID3DX10Sprite::DrawSpritesBuffered which only adds an array of sprites to a batch of sprites to be rendered when ID3DX10Sprite::Flush is called. This draw method is most useful when drawing a large number of sprites that have already been sorted on the CPU (or do not need to be sorted), such as in a particle system. This must be called in between calls to ID3DX10Sprite::Begin and ID3DX10Sprite::End.
End Call this after ID3DX10Sprite::Flush. If D3DX10_SPRITE_SAVE_STATE was specified when ID3DX10Sprite::Begin was called, this API will restore the device state to how it was before ID3DX10Sprite::Begin was called.
Flush Force all batched sprites to be submitted to the device. Device states remain as they were after the last call to ID3DX10Sprite::Begin. The list of batched sprites is then cleared.
GetDevice Retrieve the device associated with the sprite object.
GetProjectionTransform Get the sprite projection matrix that is applied to all sprites.
GetViewTransform Get the view transform that applies to all sprites.
SetProjectionTransform Set the projection matrix for all sprites.
SetViewTransform Set the view transform that applies to all sprites.

 

Remarks

The ID3DX10Sprite interface is obtained by calling the D3DX10CreateSprite function.

Requirements

Header
D3DX10.h
Library
D3DX10.lib

See also

D3DX Interfaces