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

◆ create_element() [1/2]

template<typename T >
Mapped< T > MayaFlux::Portal::Forma::internal::Atelier::create_element ( Layer layer,
std::shared_ptr< Core::Window window,
GeometryFn< T >  geom,
initial,
Graphics::PrimitiveTopology  topology = Graphics::PrimitiveTopology::TRIANGLE_STRIP,
size_t  capacity = k_capacity_bytes,
std::function< float(T)>  project = {} 
)
inline

Build a FormaBuffer, construct a Mapped<T>, register the element on layer, and register it with the Bridge.

Template Parameters
TMappedState value type.
Parameters
layerLayer to register the element on.
windowTarget window for rendering.
geomGeometry function producing vertex bytes from T.
initialStarting value written into MappedState.
topologyPrimitive topology for the FormaBuffer.
capacityInitial FormaBuffer capacity in bytes.
projectOptional T to float projection for outbound readers.

Definition at line 146 of file Atelier.hpp.

153 {})
154 {
155 auto buf = create_buffer(std::move(window), capacity, topology);
156 auto mapped = make_mapped<T>(std::move(initial), std::move(geom), std::move(buf));
157 mapped.element.id = layer.add(mapped.element);
158 bridge().register_element(mapped, std::move(project));
159 return mapped;
160 }
void register_element(std::shared_ptr< MappedState< T > > state, uint32_t id, std::shared_ptr< Buffers::FormaBuffer > buffer, std::function< float(T)> project={})
Register a MappedState<T> so that MappedState overloads and outbound bindings can resolve to the corr...
Definition Bridge.hpp:280
std::shared_ptr< Buffers::FormaBuffer > create_buffer(std::shared_ptr< Core::Window > window, size_t capacity, Graphics::PrimitiveTopology topology, const std::string &texture_binding={}, std::vector< std::pair< std::string, std::shared_ptr< Core::VKImage > > > additional_textures={})
Capacity-explicit FormaBuffer construction.
Definition Atelier.cpp:108
Bridge & bridge()
Bridge instance constructed during initialize.
Definition Atelier.cpp:77

Referenced by MayaFlux::Portal::Forma::plot().

+ Here is the caller graph for this function: