Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueInt32 C# (CSharp) Метод

GetValueInt32() публичный Метод

public GetValueInt32 ( ) : int
Результат int
		public int GetValueInt32 ()
		{
            if (ParameterClass != EffectParameterClass.Scalar || ParameterType != EffectParameterType.Int32)
                throw new InvalidCastException();

#if DIRECTX
            return ((int[])Data)[0];
#else
            // MojoShader encodes integers into a float.
            return (int)((float[])Data)[0];
#endif
        }
        

Usage Example

Пример #1
0
 /// <summary>
 /// Gets the value of the parameter as an int.
 /// </summary>
 /// <returns>
 /// The int value
 /// </returns>
 public int GetValueInt()
 {
     return(_param.GetValueInt32());
 }