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

◆ create_element() [2/2]

template<typename T >
Mapped< T > MayaFlux::Portal::Forma::internal::Atelier::create_element ( Surface surface,
GeometryFn< T >  geom,
initial,
Graphics::PrimitiveTopology  topology = Graphics::PrimitiveTopology::TRIANGLE_STRIP,
std::function< float(T)>  project = {} 
)
inline

create_element against a Surface, followed by one sync so bounds_hint and contains from the geometry function reach the Layer before the first frame.

Definition at line 168 of file Atelier.hpp.

173 {})
174 {
175 auto mapped = create_element<T>(
176 surface.layer(), surface.window(),
177 std::move(geom), std::move(initial),
178 topology, k_capacity_bytes, std::move(project));
179
180 mapped.sync();
181 if (mapped.element.bounds_hint)
182 surface.layer().set_bounds(mapped.element.id, *mapped.element.bounds_hint);
183 if (mapped.element.contains)
184 surface.layer().set_contains(mapped.element.id, mapped.element.contains);
185
186 return mapped;
187 }
constexpr size_t k_capacity_bytes
Definition Atelier.hpp:34