Sign in to follow this  
Odoacer

modifying D3DXSPRITE batches

Recommended Posts

Odoacer    140
I know you can add sprites to the render batch via the Draw() command, but what about removing them? My game just has a few object on the screen that need to be updated, the majority will remain the same. So I was thinking it would be more efficient to just add and remove a few sprites at a time than to have to flush and re-draw all my sprites every frame.

Share this post


Link to post
Share on other sites
dhanji    192
If you are clearing the screen (or any of your sprites are moving) then you have to re-batch all the sprites. Unbatching only means removing a batched sprite that has been added in the SAME frame. Whenever you call sprite->End() it flushes the sprite batch anyway.
There's not much point to unbatching, it's like getting ready to draw then then not drawing, so if you want a sprite not drawn, just dont batch it in your engine's Render function. A batch doesnt extend across multiple calls to sprite->Begin(), and therefore across multiple frames.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this