Esempio n. 1
0
        private VertexDeclaration(_VertexElement[] elements, _VertexElement extra)
        {
            _Elements = new _VertexElement[elements.Length + 1];
            elements.CopyTo(_Elements, 0);
            _Elements[_Elements.Length - 1] = extra;

            _Stride = _Elements.Sum(item => item._Dimensions);

            _HashCode = _Elements.Select(item => item.GetHashCode()).Aggregate((a, b) => (a * 17) ^ b);

            _PositionV3 = GetOffset("POSITION");
            _NormalV3   = GetOffset("NORMAL");
        }
Esempio n. 2
0
        public VertexDeclaration WithVector4(string attribute)
        {
            var e = new _VertexElement(attribute, 4, Stride);

            return(new VertexDeclaration(_Elements, e));
        }
Esempio n. 3
0
 public VertexDeclaration()
 {
     _Elements = new _VertexElement[0];
 }