Animating Your Sprites

To follow the same pattern that was used in the previous chapter, you should now make a copy of this code so that it can be updated to show some animated sprites.

USING NON-SQUARE SURFACES

In Direct3D textures are normally required not only to be square, but to also have each side have a length that is a power of two. Most of the modern cards out today have support for textures that don't fit these parameters, but even those that do can suffer a performance loss for using “irregularly” shaped textures.

In the previous chapter, the animated sprites file was “enlarged” to be a square with a power-of-two length, with the remaining area being filled with “unused” data just to ensure that the texture could be loaded on most ...

Get Managed DirectX® 9 Kick Start: Graphics and Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.