Device.SetGammaRamp(Int32,Boolean,GammaRamp) Method (Microsoft.DirectX.Direct3D)

Sets the gamma correction ramp for the implicit swap chain.

Definition

Visual Basic Public Sub SetGammaRamp( _
    ByVal swapChain As Integer, _
    ByVal calibrate As Boolean, _
    ByVal ramp As GammaRamp _
)
C# public void SetGammaRamp(
    int swapChain,
    bool calibrate,
    GammaRamp ramp
);
C++ public:
void SetGammaRamp(
    int swapChain,
    bool calibrate,
    GammaRamp ramp
);
JScript public function SetGammaRamp(
    swapChain : int,
    calibrate : boolean,
    ramp : GammaRamp
);

Parameters

swapChain System.Int32
Unsigned integer that specifies the swap chain.
calibrate System.Boolean
Set to true to indicate that correction should be applied. Set to false to indicate that no gamma correction should be applied. The supplied gamma table is transferred directly to the device.
ramp Microsoft.DirectX.Direct3D.GammaRamp
A GammaRamp structure that represents the gamma correction ramp to set for the implicit swap chain.

Remarks

Each device always has at least one swap chain (the implicit swap chain), because Microsoft DirectX 9.0 sets a swap chain as a device property.

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 entire screen red, should not be calibrated, but long-duration gamma changes should be. If a gamma calibrator is installed, the ramp is modified before being sent to the device to account for the system and monitor response curves. If no calibrator is installed, the ramp is passed directly to the device.

For windowed gamma correction presentation, use SwapChain.Present if the hardware supports the feature.

The gamma ramp takes effect immediately. No wait for a vertical sync operation is performed.

If the device does not support gamma ramps in the swap chain's current presentation mode (full-screen or windowed), no error is returned. Applications can check DriverCaps.SupportsFullscreenGamma and DriverCaps.CanCalibrateGamma to determine the capabilities of the device and whether a calibrator is installed.

See Also