MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ create_buffer() [2/4]

template<typename V >
requires std::ranges::contiguous_range<V> && std::is_trivially_copyable_v<std::ranges::range_value_t<V>>
std::shared_ptr< Buffers::FormaBuffer > MayaFlux::Portal::Forma::create_buffer ( std::shared_ptr< Core::Window window,
const V &  vertices,
Graphics::PrimitiveTopology  topology = Graphics::PrimitiveTopology::TRIANGLE_STRIP 
)

Construct, register, and immediately submit a FormaBuffer from vertices.

Deduces capacity and topology from the vertex type. PointVertex yields POINT_LIST, LineVertex yields LINE_LIST, MeshVertex yields TRIANGLE_STRIP. Topology may be overridden explicitly for cases like LINE_STRIP or TRIANGLE_LIST from MeshVertex data.

Template Parameters
VVertex type: PointVertex, LineVertex, or MeshVertex.
Parameters
windowTarget window.
verticesVertices to submit immediately after construction.
topologyPrimitive topology. Defaults to the canonical topology for V.
Returns
Registered, render-ready FormaBuffer with initial geometry submitted.

Definition at line 216 of file Forma.hpp.

220{
221 using Vertex = std::ranges::range_value_t<V>;
222 const size_t cap = std::ranges::size(vertices) * sizeof(Vertex);
223 auto buf = internal::create_buffer_impl(std::move(window), cap, topology);
224 buf->submit(vertices);
225 return buf;
226}

References MayaFlux::Portal::Forma::internal::create_buffer_impl().

+ Here is the call graph for this function: