Esempio n. 1
0
        public Putvi(Putbox p, Device dev)
        {
            vb = new VertexBuffer(dev, CustomVertex.Position.Size * p.alv.Count, Usage.Points,
                                  CustomVertex.Position.Format, Pool.Managed);
            DataStream dataStream = vb.Lock(0, 0, LockFlags.Discard);

            try
            {
                dataStream.WriteRange(p.alv.ToArray());
            }
            finally
            {
                vb.Unlock();
            }
            ib = new IndexBuffer(dev, 4 * p.ali.Count, Usage.Points, Pool.Managed, false);
            DataStream dataStream2 = ib.Lock(0, 0, LockFlags.Discard);

            try
            {
                dataStream2.WriteRange(p.ali.ToArray());
            }
            finally
            {
                ib.Unlock();
            }
        }
Esempio n. 2
0
 public Putvi(Putbox p, Device dev)
 {
     this.vb = new VertexBuffer(dev, CustomVertex.Position.Size * p.alv.Count, Usage.Points, CustomVertex.Position.Format, Pool.Managed);
     DataStream dataStream = this.vb.Lock(0, 0, LockFlags.Discard);
     try
     {
         dataStream.WriteRange<Vector3>(p.alv.ToArray());
     }
     finally
     {
         this.vb.Unlock();
     }
     this.ib = new IndexBuffer(dev, 4 * p.ali.Count, Usage.Points, Pool.Managed, false);
     DataStream dataStream2 = this.ib.Lock(0, 0, LockFlags.Discard);
     try
     {
         dataStream2.WriteRange<int>(p.ali.ToArray());
     }
     finally
     {
         this.ib.Unlock();
     }
 }