static VertexPositionTexture() { VertexElement[] elements = new VertexElement[] { new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0), new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0), }; VertexDeclaration d = new VertexDeclaration(20, elements); VertexDeclaration = d; }
/// <summary> /// Initializes a new instance of the <see cref="BatchInformation"/> class. /// INSTACED CONSTRUCTOR /// </summary> /// <param name="BaseVertex">The base vertex.</param> /// <param name="NumVertices">The num vertices.</param> /// <param name="PrimitiveCount">The primitive count.</param> /// <param name="StartIndex">The start index.</param> /// <param name="StreamOffset">The stream offset.</param> /// <param name="VertexDeclaration">The vertex declaration.</param> /// <param name="VertexStride">The vertex stride.</param> /// <param name="instanceCount">The instance count.</param> /// <param name="PrimitiveType">Type of the primitive.</param> public BatchInformation(int BaseVertex, int NumVertices, int PrimitiveCount, int StartIndex, int StreamOffset, VertexDeclaration VertexDeclaration, int VertexStride, int instanceCount ,PrimitiveType PrimitiveType = ANX.Framework.Graphics.PrimitiveType.TriangleList) { this.BaseVertex = BaseVertex; this.NumVertices = NumVertices; this.PrimitiveCount = PrimitiveCount; this.StartIndex = StartIndex; this.StreamOffset = StreamOffset; this.VertexDeclaration = VertexDeclaration; this.VertexStride = VertexStride; this.PrimitiveType = PrimitiveType; this.InstanceCount = instanceCount; this.BatchType = BatchType.INSTANCED; }
/// <summary> /// Initializes a new instance of the <see cref="BatchInformation"/> class. /// Indexed or Normal /// Use OTHER constructor to created INSTANCED /// </summary> /// <param name="BaseVertex">The base vertex.</param> /// <param name="NumVertices">The num vertices.</param> /// <param name="PrimitiveCount">The primitive count.</param> /// <param name="StartIndexOrVertex">The start index or vertex.</param> /// <param name="StreamOffset">The stream offset.</param> /// <param name="VertexDeclaration">The vertex declaration.</param> /// <param name="VertexStride">The vertex stride.</param> /// <param name="BatchType">Type of the batch.</param> /// <param name="PrimitiveType">Type of the primitive.</param> public BatchInformation(int BaseVertex, int NumVertices, int PrimitiveCount, int StartIndexOrVertex, int StreamOffset, VertexDeclaration VertexDeclaration, int VertexStride, BatchType BatchType,PrimitiveType PrimitiveType = PrimitiveType.TriangleList) { if (BatchType == BatchType.INSTANCED) throw new Exception("This constructor cannot be used to creat instanced BatchInformation, use the other one"); this.BaseVertex = BaseVertex; this.NumVertices = NumVertices; this.PrimitiveCount = PrimitiveCount; this.StreamOffset = StreamOffset; this.VertexDeclaration = VertexDeclaration; this.VertexStride = VertexStride; this.BatchType = BatchType; if (BatchType == BatchType.INDEXED) { this.StartIndex = StartIndexOrVertex; } else { this.StartVertex = StartIndexOrVertex; } this.PrimitiveType = PrimitiveType; }