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

◆ create_surface()

MAYAFLUX_API Surface MayaFlux::Portal::Forma::create_surface ( std::shared_ptr< Core::Window window,
std::string  name 
)

Construct a Surface, creating Layer and Context internally.

Builds a fresh Layer and a Context wired to window using the EventManager stored by Portal::Forma::initialize. Equivalent to Portal::Forma::create_layer(window, name) plus owning the window pointer alongside.

For the power-tinkerer case (custom Context subclass, shared Layer across multiple Contexts, etc.), construct Surface directly via its (Window, Layer, Context) constructor.

Parameters
windowTarget window. Must outlive the Surface.
nameUnique name scoping the Context's event coroutines. Must be unique across all live Contexts.
Precondition
Portal::Forma::initialize() must have been called.
Returns
A new Surface owning the window pointer plus the freshly created Layer and Context.

Definition at line 234 of file Forma.cpp.

237{
238 auto [layer, ctx] = create_layer(window, std::move(name));
239 return { std::move(window), std::move(layer), std::move(ctx) };
240}
std::pair< std::shared_ptr< Layer >, std::shared_ptr< Context > > create_layer(const std::shared_ptr< Core::Window > &window, std::string name)
Construct a Layer and a Context wired to window.
Definition Forma.cpp:202

References create_layer().

Referenced by inspect(), inspect(), inspect(), inspect(), inspect_buffers(), inspect_events(), inspect_node_graph(), inspect_scheduler(), and plot().

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