SND\AstrorEnales_cp cfe19d5c4a - Implemented a dynamic parameter buffer for shader parameters
- Updated the Metro shader generator
- Fixed the metro resolution being correctly set to the graphics device
2012-08-19 14:38:58 +00:00

81 lines
1.6 KiB
C#

using System;
using System.Globalization;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework
{
[ANX.Framework.NonXNA.Development.PercentageComplete(100)]
public struct Point : IEquatable<Point>
{
#region Constants
public static Point Zero
{
get
{
return new Point(0, 0);
}
}
#endregion
#region Public
public int X;
public int Y;
#endregion
#region Constructor
public Point(int x, int y)
{
this.X = x;
this.Y = y;
}
#endregion
#region GetHashCode
public override int GetHashCode()
{
return this.X + this.Y;
}
#endregion
#region ToString
public override string ToString()
{
var culture = CultureInfo.CurrentCulture;
// This may look a bit more ugly, but String.Format should
// be avoided cause of it's bad performance!
return "{X:" + X.ToString(culture) +
" Y:" + Y.ToString(culture) + "}";
}
#endregion
#region Equals
public override bool Equals(Object obj)
{
return (obj is Point) ?
this.Equals((Point)obj) :
false;
}
public bool Equals(Point other)
{
return this.X == other.X && this.Y == other.Y;
}
#endregion
#region operator overloading
public static bool operator ==(Point first, Point second)
{
return first.X == second.X && first.Y == second.Y;
}
public static bool operator !=(Point first, Point second)
{
return first.X != second.X || first.Y != second.Y;
}
#endregion
}
}