IDirect3DDevice9::SetPaletteEntries method (d3d9.h)

Sets palette entries.

Syntax

HRESULT SetPaletteEntries(
  [in] UINT               PaletteNumber,
  [in] const PALETTEENTRY *pEntries
);

Parameters

[in] PaletteNumber

Type: UINT

An ordinal value identifying the particular palette upon which the operation is to be performed.

[in] pEntries

Type: const PALETTEENTRY*

Pointer to a PALETTEENTRY structure, representing the palette entries to set. The number of PALETTEENTRY structures pointed to by pEntries is assumed to be 256. See Remarks.

Return value

Type: HRESULT

If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be D3DERR_INVALIDCALL.

Remarks

For Direct3D 9 applications, any palette sent to this method must conform to the D3DPTEXTURECAPS_ALPHAPALETTE capability bit of the D3DCAPS9 structure. If D3DPTEXTURECAPS_ALPHAPALETTE is not set, every entry in the palette must have alpha set to 1.0 or this method will fail with D3DERR_INVALIDCALL. If D3DPTEXTURECAPS_ALPHAPALETTE is set, then any set of alpha values are allowed. Note that the debug runtime will print a warning message if all palette entries have alpha set to 0.

A single logical palette is associated with the device, and is shared by all texture stages.

Requirements

Requirement Value
Target Platform Windows
Header d3d9.h (include D3D9.h)
Library D3D9.lib

See also

IDirect3DDevice9

IDirect3DDevice9::GetCurrentTexturePalette

IDirect3DDevice9::GetPaletteEntries

IDirect3DDevice9::SetCurrentTexturePalette

Texture Palettes (Direct3D 9)