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); }
public virtual VertexLayoutBindedAttribute AddAttribute(Type type, int index, bool normalized = false) { return(AddAttribute(type, index, StructHelper.GetFieldsOf(type), normalized)); }
public virtual VertexLayoutDefinitionAttribute AddAttribute(Type type, string name, bool normalized = false) { return(AddAttribute(type, name, StructHelper.GetFieldsOf(type), normalized)); }