D3DX10_SPRITE_FLAG enumeration

Sprite flags that tell the sprite drawing API how to behave. These are passed into ID3DX10Sprite::Begin.

Syntax

typedef enum D3DX10_SPRITE_FLAG { 
  D3DX10_SPRITE_SORT_TEXTURE              = 0x01,
  D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT  = 0x02,
  D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK  = 0x04,
  D3DX10_SPRITE_SAVE_STATE                = 0x08,
  D3DX10_SPRITE_ADDREF_TEXTURES           = 0x10
} D3DX10_SPRITE_FLAG, *LPD3DX10_SPRITE_FLAG;

Constants

D3DX10_SPRITE_SORT_TEXTURE

Sort the sprites by texture before rendering so that when there are many sprites with the same texture that texture all of those sprites will be rendered at the same time, thereby improving performance.

D3DX10_SPRITE_SORT_DEPTH_BACK_TO_FRONT

Sort the sprites from back to front to that those farther away from the camera will be drawn first.

D3DX10_SPRITE_SORT_DEPTH_FRONT_TO_BACK

Sort the sprites from front to back so that those closer to the camera will be drawn first.

D3DX10_SPRITE_SAVE_STATE

Saves the state so that when ID3DX10Sprite::End is called, it will restore the state to the way it was before ID3DX10Sprite::Begin was called.

D3DX10_SPRITE_ADDREF_TEXTURES

Calls AddRef on all of the textures when they are passed into ID3DX10Sprite::DrawSpritesBuffered.

Remarks

After a front-to-back or back-to-front sort is done, it will automatically do a secondary sort by texture. This is helpful for when there are many sprites with the same texture all on the same plane, such as when drawing the user interface in a game.

Requirements

Requirement Value
Header
D3DX10Core.h

See also

D3DX Enumerations