Exemplo n.º 1
0
        public virtual VertexLayoutDefinitionAttribute AddAttribute(Type type, string name, int size, bool normalized = false)
        {
            var offset = _Stride;

            _Stride += size * StructHelper.GetFieldSizeOf(type);

            var attr = CreateAttributeInstance();

            attr.Name       = name;
            attr.Size       = size;
            attr.Type       = StructHelper.GetVertexAttribPointerType(type);
            attr.Normalized = normalized;
            attr.Stride     = 0; // will be set in UpdateStride()
            attr.Offset     = offset;

            AddAttribute(attr);
            UpdateStride();
            return(attr);
        }
Exemplo n.º 2
0
 public virtual VertexLayoutBindedAttribute AddAttribute(Type type, int index, bool normalized = false)
 {
     return(AddAttribute(type, index, StructHelper.GetFieldsOf(type), normalized));
 }
Exemplo n.º 3
0
 public virtual VertexLayoutDefinitionAttribute AddAttribute(Type type, string name, bool normalized = false)
 {
     return(AddAttribute(type, name, StructHelper.GetFieldsOf(type), normalized));
 }