94 std::size_t offset = 0;
99 offset += element.getSize();
113 std::size_t offset = 0;
117 const std::size_t length = element.getSize() * vertexCount;
118 layout.
addElement(element, offset, element.getSize());
#define CE_ASSERT(...)
Definition Macros.hpp:323
A memory view is a class which attaches to an chunk of memory and provides a view to it (optionally c...
Definition MemoryView.hpp:62
SizeType size() const noexcept
Gets the size of the view as number of elements.
Definition MemoryView.hpp:294
MemoryView< T > slice(SizeType offset, SizeType length=~0ul) const noexcept
Slices the memory view by taking the element that starts at offset and returns a new view with the gi...
Definition MemoryView.hpp:145
ConstPointer data() const noexcept
Gets a pointer to the first element in the view.
Definition MemoryView.hpp:227
A memory view is a class which attaches to an chunk of memory and provides a view to it (optionally c...
Definition MemoryView.hpp:439
Determines how a single element should be a vertex.
Definition VertexDeclaration.hpp:153
bool is() const noexcept
Checks if the vertex element type and component type matches the C++ type T.
Definition VertexDeclaration.hpp:480
std::size_t getSize() const noexcept
Returns the length, in bytes, of the vertex element.
Definition Application.hpp:19
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
constexpr CountAlgorithmFunctor count
Returns the number of elements matching an element.
Definition Count.hpp:82
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
Determines how vertices are laid-out on a vertex buffer or a mesh data.
Definition VertexDeclaration.hpp:205
Represents the memory position of a single vertex element.
Definition VertexLayout.hpp:20
StridedMemoryView< const T > view(const MemoryView< const Byte > view, const size_t count=0) const
Returns a StridedMemoryView that allows iterating over every vertex of of this element in a vertex bu...
Definition VertexLayout.hpp:45
size_t operator[](const size_t index) const
Computes the absolute offset of the vertex at position index.
Definition VertexLayout.hpp:36
size_t stride
The stride, the amount of bytes to skip to reach the next vertex data.
Definition VertexLayout.hpp:30
VertexElement element
The vertex element description.
Definition VertexLayout.hpp:23
StridedMemoryView< T > view(const MemoryView< Byte > view, const size_t count=0) const
Returns a StridedMemoryView that allows iterating over every vertex of of this element in a vertex bu...
Definition VertexLayout.hpp:58
size_t offset
The offset to where this vertex element starts.
Definition VertexLayout.hpp:26
Contains the definition of a single vertex buffer layout.
Definition VertexLayout.hpp:66
static VertexLayout interleaved(const VertexDeclaration &declaration)
Computes a layout in which every vertex element in declaration is interleaved, that is,...
Definition VertexLayout.hpp:92
void addElement(VertexElement element, const size_t offset, size_t stride=~0ul)
Adds a new element to the vertex layout.
Definition VertexLayout.hpp:75
Vector< VertexLayoutElement > layoutElements
Definition VertexLayout.hpp:67
static VertexLayout separated(const VertexDeclaration &declaration, const std::size_t vertexCount)
Computes a layout in which every vertex element in declaration is separated, that is,...
Definition VertexLayout.hpp:112