예제 #1
0
        public void SetVertexData(BufferView buffer, int byteOffset, ComponentType encoding, ElementType dimensions, bool normalized, int count)
        {
            Guard.NotNull(buffer, nameof(buffer));
            Guard.MustShareLogicalParent(this, buffer, nameof(buffer));
            if (buffer.DeviceBufferTarget.HasValue)
            {
                Guard.IsTrue(buffer.DeviceBufferTarget.Value == BufferMode.ARRAY_BUFFER, nameof(buffer));
            }

            Guard.MustBeGreaterThanOrEqualTo(byteOffset, 0, nameof(byteOffset));
            Guard.MustBeGreaterThan(count, 0, nameof(count));

            this._bufferView    = buffer.LogicalIndex;
            this._componentType = encoding;
            this._normalized    = normalized.AsNullable(false);
            this._type          = dimensions;
            this._byteOffset    = byteOffset;
            this._count         = count;

            _UpdateBounds(this._type.Length());
        }