1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
namespace Microsoft.Xna.Framework.Graphics
{
public struct VertexPositionColorTexture : IVertexType
{
public Vector3 Position;
public VertexElementColor Color;
public Vector2 TextureCoordinate;
public static readonly VertexDeclaration VertexDeclaration;
public VertexPositionColorTexture(Vector3 position, Color color, Vector2 textureCoordinate)
{
this.Position = position;
Color = color;
this.TextureCoordinate = textureCoordinate;
}
VertexDeclaration IVertexType.VertexDeclaration
{
get
{
return VertexDeclaration;
}
}
public override int GetHashCode()
{
// TODO: FIc gethashcode
return 0;
}
public override string ToString()
{
return string.Format("{{Position:{0} Color:{1} TextureCoordinate:{2}}}", new object[] { this.Position, this.Color, this.TextureCoordinate });
}
public static bool operator ==(VertexPositionColorTexture left, VertexPositionColorTexture right)
{
return (((left.Position == right.Position) && (left.Color == right.Color)) && (left.TextureCoordinate == right.TextureCoordinate));
}
public static bool operator !=(VertexPositionColorTexture left, VertexPositionColorTexture right)
{
return !(left == right);
}
public override bool Equals(object obj)
{
if (obj == null)
{
return false;
}
if (obj.GetType() != base.GetType())
{
return false;
}
return (this == ((VertexPositionColorTexture)obj));
}
static VertexPositionColorTexture()
{
VertexElement[] elements = new VertexElement[] { new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0), new VertexElement(12, VertexElementFormat.Color, VertexElementUsage.Color, 0), new VertexElement(0x10, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0) };
VertexDeclaration declaration = new VertexDeclaration(elements);
VertexDeclaration = declaration;
}
}
}
|