Direct3D devices can support texturing from texture surfaces that use attached palettes. These types of textures are sometimes called "palettized textures." A palettized texture is a DirectDrawSurface object, created with the DDSCAPS_TEXTURE capability, that uses one of the DDPF_PALETTEINDEXEDn pixel formats (where n is 1, 2, 4, or 8). These capabilities are included in the DDSURFACEDESC2 structure that you use to create a texture (and the DDPIXELFORMAT structure that the description contains). Like all palettized surfaces, instead of a color, each pixel is an index into a table of values held within an attached DirectDrawPalette object. For more information about creating and using palettized surfaces, see Surfaces and Palettes in the DirectDraw documentation. As you should always do when checking texture-related device capabilities, be sure to verify the supported texture pixel formats by calling the IDirect3DDevice3::EnumTextureFormats method.
To prepare a palettized texture
Note If you create a palettized texture surface, but neglect to attach a palette, your application will cause an access violation within Direct3D Immediate Mode during rendering.
The palettes you use with palettized textures need not be limited to color data. In some cases, devices support texture palettes that also contain alpha information. If so, DirectDraw will expose the DDPCAPS_ALPHA palette capability flag when you call the IDirectDraw4::GetCaps method—the flag is found in the dwPalCaps member of the associated DDCAPS structure. If the rendering device can perform texturing from alpha-capable palettized textures, it will expose the D3DPTEXTURECAPS_ALPHAPALETTE capability when you call IDirect3DDevice3::GetCaps. (The D3DPTEXTURECAPS_ALPHAPALETTE flag can be found in the two D3DPRIMCAPS structures contained by the D3DDEVICEDESC structure you pass with the call.)