Exemplo n.º 1
0
        public GPUPipelineFormat CreatePipelineFormat(GPUBufferFormat[] bufferFormats, GPUVertexFormat[] vertexFormats)
        {
            GPUPipelineFormat f = new GPUPipelineFormat(Gl.glCreateVertexArray(), bufferFormats, vertexFormats);

            BindFormat(f);
            for (uint i = 0; i < f.GetVertexFormats().Length; i++)
            {
                GPUVertexFormat vf = f.GetVertexFormats()[i];
                Gl.glEnableVertexArrayAttrib(f, vf.Location);
                Gl.glVertexArrayAttribFormat(f, vf.Location, (int)vf.Size, vf.Type, vf.Normalized, vf.RelativeOffset);
                Gl.glVertexArrayAttribBinding(f, vf.Location, vf.BufferIndex);
            }
            _vaos.Add(f);
            return(f);
        }