/// <summary> /// Linearize Gamma According to Current Gamma Value Using GraphicsDevice GammaRamp /// </summary> /// <param name="gamma">current R, G, B gamma value</param> public void SetGamma(Vector3 gamma) { bool isfullscreengamma; GraphicsDeviceCapabilities gdcap = gd.GraphicsDeviceCapabilities; if (gdcap.DriverCapabilities.SupportsFullScreenGamma) { isfullscreengamma = true; } else { isfullscreengamma = false; SLConstant.ShowMessage("This GraphicsDevice Does Not Support Full Screen Gamma Correction !"); } if (isfullscreengamma && gd.PresentationParameters.IsFullScreen && (gamma.X != 1.0f || gamma.Y != 1.0f || gamma.Z != 1.0f)) { gd.SetGammaRamp(false, SLAlgorithm.GetGamma(gamma)); } }
/// <summary> /// Linearize Gamma According to Current Gamma Value Using GraphicsDevice GammaRamp /// </summary> /// <param name="gamma">current R, G, B gamma value</param> public void SetGamma(Vector3 gamma) { bool isfullscreengamma; GraphicsDeviceCapabilities gdcap = GraphicsAdapter.DefaultAdapter.GetCapabilities(DeviceType.Hardware); if (gdcap.DriverCapabilities.SupportsFullScreenGamma) { isfullscreengamma = true; } else { isfullscreengamma = false; SLConstant.ShowMessage("This Adapter Does Not Support Full Screen Gamma Correction !"); } if (isfullscreengamma && gdm.IsFullScreen && (gamma.X != 1.0f || gamma.Y != 1.0f || gamma.Z != 1.0f)) { gdm.GraphicsDevice.SetGammaRamp(false, SLAlgorithm.GetGamma(gamma)); this.gamma = gamma; } }