Beispiel #1
0
        public void SetIndices(ushort[] indices)
        {
            int errorCode = PsmVertexBuffer.SetIndices(this.handle, indices, 0, 0, -1);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Beispiel #2
0
        public void SetVertices(int stream, Array vertices, VertexFormat format, Vector4 trans, Vector4 scale)
        {
            int errorCode = PsmVertexBuffer.SetVertices2(this.handle, stream, vertices, format, ref trans, ref scale, 0, 0, 0, 0, this.vertexCount);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Beispiel #3
0
        public void SetVertices(int stream, Array vertices, int offset, int stride)
        {
            int errorCode = PsmVertexBuffer.SetVertices2(this.handle, stream, vertices, VertexFormat.None, ref VertexBuffer.zero, ref VertexBuffer.one, offset, stride, 0, 0, this.vertexCount);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Beispiel #4
0
        public void SetVertices(Array vertices)
        {
            int errorCode = PsmVertexBuffer.SetVertices(this.handle, vertices, 0, 0, -1);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Beispiel #5
0
        protected VertexBuffer(VertexBuffer buffer)
        {
            int errorCode = PsmVertexBuffer.AddRef(buffer.handle);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
            this.handle      = buffer.handle;
            this.formats     = buffer.formats;
            this.vertexCount = buffer.vertexCount;
            this.indexCount  = buffer.indexCount;
        }
Beispiel #6
0
        public VertexBuffer(int vertexCount, int indexCount, int instDivisor, params VertexFormat[] formats)
        {
            int errorCode = PsmVertexBuffer.Create(vertexCount, indexCount, instDivisor, 0, formats, out this.handle);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
            this.formats     = formats;
            this.vertexCount = vertexCount;
            this.indexCount  = indexCount;
            this.instDivisor = instDivisor;
        }
Beispiel #7
0
        public void SetIndices(ushort[] indices, int to, int from, int count)
        {
            if (count < 0)
            {
                count = int.MaxValue;
            }
            int errorCode = PsmVertexBuffer.SetIndices(this.handle, indices, to, from, count);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Beispiel #8
0
        public void SetVertices(int stream, Array vertices, VertexFormat format, Vector4 trans, Vector4 scale, int offset, int stride, int to, int from, int count)
        {
            if (count < 0)
            {
                count = int.MaxValue;
            }
            int errorCode = PsmVertexBuffer.SetVertices2(this.handle, stream, vertices, format, ref trans, ref scale, offset, stride, to, from, count);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Beispiel #9
0
        public void SetVertices(int stream, Array vertices, int to, int from, int count)
        {
            if (count < 0)
            {
                count = int.MaxValue;
            }
            int errorCode = PsmVertexBuffer.SetVertices2(this.handle, stream, vertices, VertexFormat.None, ref VertexBuffer.zero, ref VertexBuffer.one, 0, 0, to, from, count);

            if (errorCode != 0)
            {
                Error.ThrowNativeException(errorCode);
            }
        }
Beispiel #10
0
 protected virtual void Dispose(bool disposing)
 {
     PsmVertexBuffer.Delete(this.handle);
     this.handle = 0;
 }