ID2D1SpriteBatch interface
Represents a single group of sprites with their associated drawing properties.
Members
The ID2D1SpriteBatch interface inherits from ID2D1Resource. ID2D1SpriteBatch also has these types of members:
Methods
The ID2D1SpriteBatch interface has these methods.
| Method | Description |
|---|---|
| AddSprites |
Adds the given sprites to the end of this sprite batch. |
| Clear |
Removes all sprites from this sprite batch. |
| GetSpriteCount |
Retrieves the number of sprites in this sprite batch. |
| GetSprites |
Retrieves the specified subset of sprites from this sprite batch. For the best performance, use nullptr for properties that you do not need to retrieve. |
| SetSprites |
Updates the properties of the specified sprites in this sprite batch. |
Remarks
Create a new sprite batch using ID2D1DeviceContext3::CreateSpriteBatch. Use ID2D1SpriteBatch::AddSprites to add sprites to the batch, then use ID2D1DeviceContext3::DrawSpriteBatch to draw them.
Sprites are a way for apps to draw a large number of images very efficiently. They are commonly used to render characters and backgrounds in 2D games, or to render particle systems such as smoke and flames. If your app has performance demands and needs to draw hundreds or thousands of images every frame, then consider taking advantage of sprite batches and the fine-grained control they offer, instead of the general-purpose DrawImage method.
Requirements
|
Header |
|
|---|---|
|
Library |
|
|
DLL |
|
See also