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