Inheritance: VertexBufferI
Exemplo n.º 1
0
 private void init(DisposableI parent, BufferLayoutDescI bufferLayoutDesc)
 {
     try
     {
         video = parent.FindParentOrSelfWithException<Video>();
         vertexBuffer = new VertexBuffer(this, bufferLayoutDesc, BufferUsages.Write, VertexBufferTopologys.Triangle, vertices);
     }
     catch (Exception e)
     {
         Dispose();
         throw e;
     }
 }
Exemplo n.º 2
0
        private void enable(IndexBufferI indexBuffer, VertexBufferI instanceBuffer)
        {
            if (instanceBuffer == null)
            {
                video.Device.SetVertexBuffer(vertexBuffer);
                instanceBuffer = null;
            }
            else
            {
                this.instanceBuffer = (VertexBuffer)instanceBuffer;
            }

            if (indexBuffer == null)
            {
                video.Device.Indices = null;
                indexBuffer = null;
            }
            else
            {
                this.currentIndexBuffer = (IndexBuffer)indexBuffer;
                this.currentIndexBuffer.enable();
            }
        }