Пример #1
0
        public static VertexArray CreateVertexArray(Context context, int positionLocation)
        {
            Vector4F[]   positions       = new[] { new Vector4F(0, 0, 0, 1) };
            VertexBuffer positionsBuffer = Device.CreateVertexBuffer(BufferHint.StaticDraw, ArraySizeInBytes.Size(positions));

            positionsBuffer.CopyFromSystemMemory(positions);

            VertexArray va = context.CreateVertexArray();

            va.Attributes[positionLocation] = new VertexBufferAttribute(positionsBuffer, ComponentDatatype.Float, 4);
            va.DisposeBuffers = true;

            return(va);
        }