|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
| Mapped< T > MayaFlux::Portal::Forma::create_element | ( | Layer & | layer, |
| std::shared_ptr< Core::Window > | window, | ||
| GeometryFn< T > | geom, | ||
| T | initial, | ||
| Graphics::PrimitiveTopology | topology = Graphics::PrimitiveTopology::TRIANGLE_STRIP, |
||
| size_t | capacity = internal::k_capacity_bytes, |
||
| std::function< float(T)> | project = {} |
||
| ) |
Build a FormaBuffer, register it, construct a Mapped<T>, and add the element to layer.
BufferManager is taken from the stored initialize() state. Returns the fully constructed Mapped<T>. The caller holds it. element.id is stable and can be passed to Context callbacks and Bridge.
| T | MappedState value type: float, glm::vec2, etc. |
| layer | Layer to register the element on. |
| window | Target window for rendering. |
| geom | Geometry function producing vertex bytes from T. |
| initial | Starting value written into MappedState. |
| topology | Primitive topology for the FormaBuffer. |
| capacity | Initial FormaBuffer capacity in bytes. |
| project | Optional T -> float projection for outbound readers. |
layer. Definition at line 287 of file Forma.hpp.