Platform SDK: DirectX |
The IDirectDrawGammaControl::SetGammaRamp method retrieves the red, green, and blue gamma ramps for the primary surface.
HRESULT SetGammaRamp( DWORD dwFlags, LPGAMMARAMP lpRampData );
If the method succeeds, the return value is DD_OK.
If it fails, the method can return one of the following error values:
DDERR_EXCEPTION |
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
DDERR_OUTOFMEMORY |
Not all systems support gamma calibration. To determine whether gamma calibration is supported, call IDirectDraw7::GetCaps, and examine the dwCaps2 member of the associated DDCAPS structure after the method returns. If the DDCAPS2_CANCALIBRATEGAMMA capability flag is present, gamma calibration is supported.
Calibrating gamma ramps incurs some processing overhead and should not be used frequently.
Including the DDSGR_CALIBRATE flag in the dwFlags parameter when running on systems that do not support gamma calibration does not cause this method to fail. The method succeeds, setting new gamma ramp values without calibration.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.
IDirectDrawGammaControl::GetGammaRamp, Gamma and Color Controls