+++ /dev/null
-using System;\r
-using System.Collections.Generic;\r
-using System.Text;\r
-using System.Runtime.InteropServices;\r
-using System.Globalization;\r
-using SharpDX;\r
-using SharpDX.Direct3D9;\r
-\r
-namespace FDK\r
-{\r
- [StructLayout( LayoutKind.Sequential )]\r
- public struct PositionColoredTexturedVertex : IEquatable<PositionColoredTexturedVertex>\r
- {\r
- public Vector3 Position;\r
- public int Color;\r
- public Vector2 TextureCoordinates;\r
-\r
- public static int SizeInBytes\r
- {\r
- get\r
- {\r
- return Marshal.SizeOf( typeof( PositionColoredTexturedVertex ) );\r
- }\r
- }\r
- public static VertexFormat Format\r
- {\r
- get\r
- {\r
- return ( VertexFormat.Texture1 | VertexFormat.Diffuse | VertexFormat.Position );\r
- }\r
- }\r
- public PositionColoredTexturedVertex( Vector3 position, int color, Vector2 textureCoordinates )\r
- {\r
- this = new PositionColoredTexturedVertex();\r
- this.Position = position;\r
- this.Color = color;\r
- this.TextureCoordinates = textureCoordinates;\r
- }\r
-\r
- public static bool operator ==( PositionColoredTexturedVertex left, PositionColoredTexturedVertex right )\r
- {\r
- return left.Equals( right );\r
- }\r
- public static bool operator !=( PositionColoredTexturedVertex left, PositionColoredTexturedVertex right )\r
- {\r
- return !( left == right );\r
- }\r
- public override int GetHashCode()\r
- {\r
- return ( ( this.Position.GetHashCode() + this.Color.GetHashCode() ) + this.TextureCoordinates.GetHashCode() );\r
- }\r
- public override bool Equals( object obj )\r
- {\r
- if( obj == null )\r
- {\r
- return false;\r
- }\r
- if( base.GetType() != obj.GetType() )\r
- {\r
- return false;\r
- }\r
- return this.Equals( (PositionColoredTexturedVertex) obj );\r
- }\r
- public bool Equals( PositionColoredTexturedVertex other )\r
- {\r
- return ( ( ( this.Position == other.Position ) && ( this.Color == other.Color ) ) && ( this.TextureCoordinates == other.TextureCoordinates ) );\r
- }\r
- public override string ToString()\r
- {\r
- return string.Format( CultureInfo.CurrentCulture, "{0} ({1}, {2})", new object[] { this.Position.ToString(), System.Drawing.Color.FromArgb( this.Color ).ToString(), this.TextureCoordinates.ToString() } );\r
- }\r
- }\r
-}\r