The DirectDrawPalette object is provided to enable direct manipulation of 16- and 256-color palettes. (A DirectDrawPalette object is typically attached to a DirectDrawSurface object.) A DirectDrawPalette object reserves entries 0 through 255 for 256-color palettes; it does not reserve any entries for 16-color palettes. It allows direct manipulation of the color table as a table. A color table is an array of color values (typically RGB triplets). This table can contain 16- or 24-bit RGB entries representing the colors associated with each of the indexes. For 16-color palettes, the table can also contain indexes to another 256-color palette.
An application can retrieve the entries in these tables by using the IDirectDrawPalette::GetEntries method, and it can change these entries by using the IDirectDrawPalette::SetEntries method. This method has a dwFlags parameter that specifies when the changes to the palette should take effect.
You can choose between two methods for providing straightforward palette animation using DirectDrawPalette objects. Using the first method, you change the palette entries that correspond to the colors that need to be animated. You can do this with a single call to the IDirectDrawPalette::SetEntries method. The second method requires two DirectDrawPalette objects. The application performs the animation by attaching one object after the other to the DirectDrawSurface object. You can do this by using the IDirectDrawSurface2::SetPalette method.