Exemplo n.º 1
0
        public VertexLayoutBinded BindToShader(RendererShader shader)
        {
            var layout = new VertexLayoutBinded();

            layout._Stride = _Stride;
            foreach (var srcAttr in Attributes)
            {
                var attr = layout.CreateAttributeInstance() as VertexLayoutBindedAttribute;
                srcAttr.CopyTo(attr);
                attr.Index = shader.GetAttribLocation(shader.AttributeNameForField(attr.Name));
                layout.AddAttribute(attr);
            }
            return(layout);
        }
Exemplo n.º 2
0
 public VertexArrayObject(VertexLayoutBinded layout, VertexBufferObject vbo = null, ElementsBufferObject ebo = null)
 {
     Layout = layout;
     _vbo   = vbo;
     _ebo   = ebo;
 }