コード例 #1
0
 public void Upload(IMesh newMesh)
 {
     if (newMesh is Mesh <TVertex> )
     {
         Mesh <TVertex> theMesh = newMesh as Mesh <TVertex>;
         vertices     = theMesh.vertices;
         numVertices  = theMesh.Length;
         vertexFormat = theMesh.VertexFormat;
         uploaded     = false;
         // Vertex format has to stay the same, no need to change attrib array
     }
 }
コード例 #2
0
        public VertexArray(VertexBuffer <TVertex> vertexBuffer, Shader shader, VertexFormat vertexFormat)
        {
            // Construct array of VertexAttribute from vertex format:
            List <VertexAttribute> attrs = new List <VertexAttribute>();

            foreach (var attr in vertexFormat.Attributes)
            {
                attrs.Add(new VertexAttribute(attr.Name,
                                              VertexFormat.NumberOfFloatsInType(attr.Type),
                                              VertexAttribPointerType.Float, vertexFormat.size, attr.Offset));
            }
            Initialize(vertexBuffer, shader, attrs.ToArray());
        }
コード例 #3
0
ファイル: Mesh.cs プロジェクト: DavidIanSteele/WorldGen
 public Mesh(TVertex[] vertices)
 {
     this.vertexFormat = vertices[0].GetVertexFormat();
     this.vertices     = vertices;
 }