wglSetLayerPaletteEntries function (wingdi.h)

Sets the palette entries in a given color-index layer plane for a specified device context.

Syntax

int wglSetLayerPaletteEntries(
  HDC            unnamedParam1,
  int            unnamedParam2,
  int            unnamedParam3,
  int            unnamedParam4,
  const COLORREF *unnamedParam5
);

Parameters

unnamedParam1

Type: HDC

The device context of a window whose layer palette is to be set.

unnamedParam2

Type: int

An overlay or underlay plane. Positive values of iLayerPlane identify overlay planes, where 1 is the first overlay plane over the main plane, 2 is the second overlay plane over the first overlay plane, and so on. Negative values identify underlay planes, where 1 is the first underlay plane under the main plane, 2 is the second underlay plane under the first underlay plane, and so on. The number of overlay and underlay planes is given in the bReserved member of the PIXELFORMATDESCRIPTOR structure.

unnamedParam3

Type: int

The first palette entry to be set.

unnamedParam4

Type: int

The number of palette entries to be set.

unnamedParam5

Type: const COLORREF*

A pointer to the first member of an array of cEntries structures that contain RGB color information.

Return value

Type: int

If the function succeeds, the return value is the number of entries that were set in the palette in the specified layer plane of the window. If the function fails or no pixel format is selected, the return value is zero. To get extended error information, call GetLastError.

Remarks

Each color-index plane in a window has a palette with a size 2^n, where n is the number of bit planes in the layer plane. You cannot modify the transparent index of a palette.

Use the wglRealizeLayerPalette function to realize the layer palette. Initially the layer palette contains only entries for white.

The wglSetLayerPaletteEntries function doesn't set the palette entries of the main plane palette. To update the main plane palette, use GDI palette functions.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header wingdi.h
Library Opengl32.lib
DLL Opengl32.dll

See also

LAYERPLANEDESCRIPTOR

OpenGL on Windows

PIXELFORMATDESCRIPTOR

WGL Functions

wglDescribeLayerPlane

wglGetLayerPaletteEntries

wglRealizeLayerPalette