Platform SDK: DirectX |
Palette animation refers to the process of modifying a surface's palette to change how the surface itself looks when displayed. By repeatedly changing the palette, the surface appears to change without actually modifying the contents of the surface. To this end, palette animation gives you a way to modify the appearance of a surface without changing its contents and with very little overhead.
There are two methods for providing straightforward palette animation:
Using the first method, you change individual palette entries that correspond to the colors you want to animate, then reset the entries with a single call to the IDirectDrawPalette::SetEntries method.
The second method requires two or more DirectDrawPalette objects. When using this method, you perform the animation by attaching one palette object after another to the surface object by calling the IDirectDrawSurface7::SetPalette method.
Neither method is hardware intensive, so use whichever technique works best for your application.
For specific information and an example of how to implement palette animation, see Tutorial 5: Dynamically Modifying Palettes.
Using the first method, you change individual palette entries that correspond to the colors you want to animate, then reset the entries with a single call to the DirectDrawPalette.SetEntries method.
The second method requires two or more DirectDrawPalette objects. When using this method, you perform the animation by attaching one palette object after another to the surface object by calling the DirectDrawSurface7.SetPalette method.
Neither method is hardware intensive, so use whichever technique works best for your application.