Microsoft DirectX 9.0

IDirectDrawSurface::GetPalette

The GetPalette method returns the IDirectDrawPalette interface associated with this surface. If no palette has been explicitly associated with this surface then it returns NULL for the associated palette, unless this is the primary surface or a back buffer to the primary surface, in which case it returns a pointer to the system palette if the primary surface is in 8bpp mode.

Syntax

HRESULT GetPalette(
  LPLPDIRECTDRAWPALETTE lplpDDPalette
  );

Parameters

lplpDDPalette

Points to a pointer to an IDirectDrawPalette interface. This will be set to NULL if there is no palette associated with this surface.

Return Values

Value Description
DD_OK The method succeeded.
DDERR_INVALIDOBJECT DirectDraw received a pointer that was an invalid DirectDraw object.
DDERR_INVALIDPARAMS One or more of the input parameters is invalid.
DDERR_SURFACELOST Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.
DDERR_UNSUPPORTED Action not supported.
DDERR_GENERIC Generic failure.
DDERR_NOEXCLUSIVEMODE Operation requires the application to have exclusive mode but the application does not have exclusive mode.
DDERR_NOPALETTEATTACHED No palette object attached to this surface.

See Also