cubos::engine::UIDrawList class final

Holds a collections of draw commands and their data.

Public types

struct Command
Describes a UI draw instruction.
struct Entry
Describes a draw commands and how it fits into the draw list carrying it.
class EntryBuilder
Builds an Entry.
struct Type
Describes a UI draw call type.

Constructors, destructors, conversion operators

UIDrawList()
Constructs a draw list.
UIDrawList(UIDrawList&& other) noexcept
Move constructs.
UIDrawList(const UIDrawList& other) noexcept
Copy constructs.

Public functions

auto push(const Type& type, const Command& command, const void* data) -> EntryBuilder
Adds entry to the draw list.
auto push(const Type& type, core::gl::VertexArray vertexArray, size_t vertexOffset, size_t vertexCount, const void* data) -> EntryBuilder
Creates a new entry in the draw list.
void clear()
Empties draw list.
auto size() const -> std::size_t
Gets list size.
auto entry(std::size_t i) const -> const Entry&
Gets an entry from the list.
auto data(std::size_t i) const -> const void*
Gets the data of an entry.

Function documentation

cubos::engine::UIDrawList::UIDrawList(UIDrawList&& other) noexcept

Move constructs.

Parameters
other Other draw list.

cubos::engine::UIDrawList::UIDrawList(const UIDrawList& other) noexcept

Copy constructs.

Parameters
other Other draw list.

EntryBuilder cubos::engine::UIDrawList::push(const Type& type, const Command& command, const void* data)

Adds entry to the draw list.

Parameters
type Command type.
command UI draw command.
data Command data.
Returns A builder for the created entry.

EntryBuilder cubos::engine::UIDrawList::push(const Type& type, core::gl::VertexArray vertexArray, size_t vertexOffset, size_t vertexCount, const void* data)

Creates a new entry in the draw list.

Parameters
type Command type.
vertexArray Vertex array handle.
vertexOffset Index of the first vertex to be drawn.
vertexCount Number of vertexes to draw.
data Command data.
Returns A builder for the created entry.

std::size_t cubos::engine::UIDrawList::size() const

Gets list size.

Returns Number of elements in the list.

const Entry& cubos::engine::UIDrawList::entry(std::size_t i) const

Gets an entry from the list.

Parameters
i Entry index.
Returns A list entry.

const void* cubos::engine::UIDrawList::data(std::size_t i) const

Gets the data of an entry.

Parameters
i Entry index.
Returns A pointer to the entry's data.