Пример #1
0
        public Vao(IShape shape)
        {
            if (shape == null)
            {
                return;
            }
            GL.GenVertexArrays(1, out _vao);
            GL.BindVertexArray(VaoID);
            _vertexVbo = shape.AcquireVbo(VboType.Vertex);
            _indexVbo  = shape.AcquireVbo(VboType.Index);
            GL.BindBuffer(BufferTarget.ArrayBuffer, _vertexVbo.BufferID);
            GL.EnableVertexAttribArray(0);
            var size = shape.StripeCount.AxesCount();

            GL.VertexAttribPointer(0, size, VertexAttribPointerType.Float, false, 0, 0);
            GL.BindBuffer(BufferTarget.ElementArrayBuffer, _indexVbo.BufferID);
            GL.BindVertexArray(0);
        }