|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Where an element's geometry and texture are written. More...
#include <Target.hpp>
Collaboration diagram for MayaFlux::Portal::Forma::FormaTarget:Classes | |
| struct | State |
Public Types | |
| using | SliceId = Buffers::FormaBuffer::SliceId |
Public Member Functions | |
| void | bind_texture (uint32_t array_index, const std::shared_ptr< Core::VKImage > &image) const |
| Bind a texture in the buffer's texture array. | |
| void | bring_to_front (int64_t priority) const |
| Draw this target after the others. | |
| const std::shared_ptr< Buffers::FormaBuffer > & | buffer () const noexcept |
| The underlying buffer; null for an empty handle. | |
| FormaTarget ()=default | |
| FormaTarget (std::nullptr_t) noexcept | |
| FormaTarget (std::shared_ptr< Buffers::FormaBuffer > buffer) | |
| The whole buffer. | |
| FormaTarget (std::shared_ptr< Buffers::FormaBuffer > buffer, SliceId slice) | |
One slice of buffer, as returned by FormaBuffer::add_slice. | |
| operator bool () const noexcept | |
| Buffers::FormaBuffer & | operator* () const noexcept |
| Buffers::FormaBuffer * | operator-> () const noexcept |
| void | retire () const |
| Release this target: retire a whole buffer, or remove a slice. | |
| void | send_to_back (int64_t priority) const |
| Draw this target before the others. | |
| void | set_visible (bool visible) const |
| Show or hide this target's output. | |
| SliceId | slice () const noexcept |
| Slice id, 0 when the handle means the whole buffer. | |
| void | submit (const std::vector< uint8_t > &bytes) const |
| Replace this target's geometry. | |
| template<typename V > requires std::is_trivially_copyable_v<V> && (!std::ranges::range<V>) | |
| void | submit (const V &vertex) const |
| Replace this target's geometry with a single vertex. | |
| template<typename V > requires std::ranges::contiguous_range<V> && std::is_trivially_copyable_v<std::ranges::range_value_t<V>> | |
| void | submit (const V &vertices) const |
| Replace this target's geometry with a contiguous range of vertices. | |
Static Public Member Functions | |
| static FormaTarget | slice_of (const std::shared_ptr< Buffers::FormaBuffer > &buffer, std::optional< Graphics::PrimitiveTopology > topology=std::nullopt) |
A new empty slice of buffer, drawn after the others. | |
Private Attributes | |
| std::shared_ptr< State > | m_state |
Friends | |
| bool | operator== (const FormaTarget &a, const FormaTarget &b) noexcept |
| bool | operator== (const FormaTarget &a, const std::shared_ptr< Buffers::FormaBuffer > &b) noexcept |
| bool | operator== (const FormaTarget &a, std::nullptr_t) noexcept |
Where an element's geometry and texture are written.
A handle to a FormaBuffer, or to one slice of a FormaBuffer that several elements share. Everything that writes or controls an element's output goes through it, so the element does not need to know whether it owns a buffer or a slice of one. A shared_ptr<FormaBuffer> converts to it implicitly and means the whole buffer, so code that creates its own buffer is unchanged.
Copies of one handle share their state: when a slice moves to another buffer, every copy follows. operator-> reaches the underlying buffer for buffer-level state such as the render processor or vertex layout; content and visibility go through the methods below.
Definition at line 22 of file Target.hpp.