Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.SetGammaRamp

Sets the gamma correction ramp for the implicit swap chain.

object.SetGammaRamp( _ 
    Flags As Long, _ 
    Ramp As D3DGAMMARAMP)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
Flags
Indicates whether correction should be applied. Gamma correction results in a more consistent display, but it 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 values defined by the CONST_D3DSGRFLAGS enumeration can be set.
Ramp
A D3DGAMMARAMP type, representing the gamma correction ramp to be set for the implicit swap chain.

Error Codes

If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

There is always at least one swap chain (the implicit swap chain) for each device because Microsoft® Direct3D® has one swap chain as a property of the device.

Because the gamma ramp is a property of the swap chain, the gamma ramp may be applied when the swap chain is windowed.

The gamma ramp takes effect immediately. No wait for VSYNC is performed.

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 D3DCAPS8 type to determine the capabilities of the device and whether a calibrator is installed.

See Also

Direct3D8.CreateDevice, Direct3DDevice8.GetGammaRamp