예제 #1
0
        protected void InitBase(ref VertexBufferStreamLayout layout)
        {
            if (layout.descs == null || layout.descs.Length == 0)
            {
                throw new ArgumentException("VertexBufferStreamLayout must have at least one desc object");
            }

            vertexBuffers = new VertexBufferBase[layout.descs.Length];
            for (int i = 0; i != layout.descs.Length; ++i)
            {
                vertexBuffers[i] = layout.descs[i].vertexBuffer;
            }

            if (layout.vertexCount == 0)
            {
                vertexCount = layout.descs[0].vertexBuffer.vertexCount;
            }
            else
            {
                vertexCount = layout.vertexCount;
            }
        }
 /// <summary>
 /// Sets vertex buffer (NOTE: RenderState will set this for you)
 /// </summary>
 public abstract void SetVertexBuffer(VertexBufferBase vertexBuffer);