Expand Minimize

IDirect3DDevice9::SetGammaRamp method

Sets the gamma correction ramp for the implicit swap chain. This method will affect the entire screen (not just the active window if you are running in windowed mode).

Syntax


void SetGammaRamp(
  [in]  UINT  iSwapChain,
  [in]  DWORD Flags,
  [in]  const D3DGAMMARAMP *pRamp
);

Parameters

iSwapChain [in]

Type: UINT

Unsigned integer specifying the swap chain.

Flags [in]

Type: DWORD

Indicates whether correction should be applied. Gamma correction results in a more consistent display, but can incur processing overhead and should not be used frequently. Short-duration effects, such as flashing the whole screen red, should not be calibrated, but long-duration gamma changes should be calibrated. One of the following values can be set:

ItemDescription

D3DSGR_CALIBRATE

If a gamma calibrator is installed, the ramp will be modified before being sent to the device to account for the system and monitor response curves. If a calibrator is not installed, the ramp will be passed directly to the device.

D3DSGR_NO_CALIBRATION

No gamma correction is applied. The supplied gamma table is transferred directly to the device.

 

pRamp [in]

Type: const D3DGAMMARAMP*

Pointer to a D3DGAMMARAMP structure, representing the gamma correction ramp to be set for the implicit swap chain.

Return value

No return value.

Remarks

There is always at least one swap chain (the implicit swap chain) for each device, because Direct3D 9 has one swap chain as a property of the device. The gamma ramp takes effect immediately; there is no wait for a vertical sync.

If the device does not support gamma ramps in the swap chain's current presentation mode (full-screen or windowed), no error return is given. Applications can check the D3DCAPS2_FULLSCREENGAMMA and D3DCAPS2_CANCALIBRATEGAMMA capability bits in the Caps2 member of the D3DCAPS9 structure to determine the capabilities of the device and whether a calibrator is installed.

For windowed gamma correction presentation, use IDirect3DSwapChain9::Present if the hardware supports the feature. In DirectX 8, SetGammaRamp will set the gamma ramp only on a full-screen mode application. For more information about gamma correction, see Gamma (Direct3D 9).

Requirements

Header

D3D9.h

Library

D3D9.lib

See also

IDirect3DDevice9
IDirect3DSwapChain9
IDirect3DDevice9::GetGammaRamp

 

 

Community Additions

ADD
Show:
© 2014 Microsoft