Esempio n. 1
0
 /// <summary>
 /// Creates a new object that is a copy of the current instance
 /// </summary>
 /// <returns></returns>
 public override object Clone()
 {
     if (gdRef != null)
     {
         return(new Text(distance2Display, displayRatio, displaySize, globalCamera, unit, gdRef, contentManager.ServiceProvider, contentManager.RootDirectory, Para));
     }
     else
     {
         SLConstant.ShowMessage("No Internal GraphicsDevice Reference, Please InitVS(GraphicsDevice gd) First !");
         return("No gdRef");
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a new object that is a copy of the current instance
 /// </summary>
 /// <returns></returns>
 public override object Clone()
 {
     if (gdRef != null)
     {
         return(new Primitive(distance2Display, displayRatio, displaySize, globalCamera, unit, gdRef, Para));
     }
     else
     {
         SLConstant.ShowMessage("No Internal GraphicsDevice Reference, Please InitVS(GraphicsDevice gd) First !");
         return("No gdRef");
     }
 }
Esempio n. 3
0
        /// <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));
            }
        }
Esempio n. 4
0
        /// <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;
            }
        }