Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueBoolean C# (CSharp) Method

GetValueBoolean() public method

public GetValueBoolean ( ) : bool
return bool
        public bool GetValueBoolean ()
		{
            if (ParameterClass != EffectParameterClass.Scalar || ParameterType != EffectParameterType.Bool)
                throw new InvalidCastException();

#if DIRECTX
            return ((int[])Data)[0] != 0;
#else
            // MojoShader encodes even booleans into a float.
            return ((float[])Data)[0] != 0.0f;
#endif
        }
        

Usage Example

Beispiel #1
0
 /// <summary>
 /// Gets the value of the parameter as a bool.
 /// </summary>
 /// <returns>
 /// Bool value
 /// </returns>
 public bool GetValueBoolean()
 {
     return(_param.GetValueBoolean());
 }