Example #1
0
        /// <summary>
        /// Создаёт массив вершин для отрисовки.
        /// </summary>
        /// <param name="info">Атрибуты вершин.</param>
        public VertexGroup(VertexArrayInfo info)
        {
            // пройтись по всем свойствам объекта; рефлексия?
            VAO = new VertexArrayObject(info.Count);
            VBO = new List <VertexBufferObject>();
            int i = 0;

            foreach (var e in info.Properties)
            {
                VBO.Add(new VertexBufferObject(e));
                VAO.AttachVBO(i, VBO[i], 3, VertexAttribPointerType.Float, Vector3.SizeInBytes, 0);
                i++;
            }
            DrawType = info.DrawType;
        }
Example #2
0
File: Shape.cs Project: esiole/MyGL
 protected void AddVertexGroup(VertexArrayInfo info)
 {
     VertexGroups.Add(new VertexGroup(info));
 }