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

◆ create_layer()

MAYAFLUX_API std::pair< std::shared_ptr< Layer >, std::shared_ptr< Context > > MayaFlux::Portal::Forma::create_layer ( const std::shared_ptr< Core::Window > &  window,
std::string  name 
)

Construct a Layer and a Context wired to window.

EventManager is taken from the stored initialize() state. The caller owns both returned objects. The Context cancels its event coroutines on destruction.

Parameters
windowTarget window surface.
nameUnique name scoping the Context's event coroutines.
Returns
Pair of { shared_ptr<Layer>, shared_ptr<Context> }.

Definition at line 202 of file Forma.cpp.

205{
206 auto layer = std::make_shared<Layer>();
207 auto ctx = std::make_shared<Context>(layer, window, *g_event_manager, std::move(name));
208
209 MayaFlux::store(ctx);
210
211 return { std::move(layer), std::move(ctx) };
212}
std::shared_ptr< T > store(std::shared_ptr< T > obj)
Transfer ownership of an existing object to the persistent store for process lifetime.
Definition Persist.hpp:28

References MayaFlux::store().

Referenced by create_surface().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: