CSharpGL.Demos.TrefoilKnotModel.GetVertexAttributeBuffer C# (CSharp) Метод

GetVertexAttributeBuffer() публичный Метод

获取指定的顶点属性缓存。

Gets specified vertex buffer object.

public GetVertexAttributeBuffer ( string bufferName, string varNameInShader ) : VertexBuffer
bufferName string buffer name(Gets this name from 'strPosition' etc.
varNameInShader string name in vertex shader like `in vec3 in_Position;`.
Результат VertexBuffer
        public VertexBuffer GetVertexAttributeBuffer(string bufferName, string varNameInShader)
        {
            if (bufferName == strPosition)
            {
                if (this.positionBuffer == null)
                {
                    this.positionBuffer = GetPositionBuffer(varNameInShader);
                }
                return this.positionBuffer;
            }
            else if (bufferName == strTexCoord)
            {
                if (this.colorBuffer == null)
                {
                    this.colorBuffer = GetTexCoordBuffer(varNameInShader);
                }
                return this.colorBuffer;
            }
            else
            {
                throw new ArgumentException();
            }
        }