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

◆ remove_render_sink()

MAYAFLUX_API void MayaFlux::Nexus::remove_render_sink ( std::vector< RenderSink > &  sinks,
Buffers::BufferManager mgr,
const std::shared_ptr< Core::Window > &  window 
)

Unregister and destroy the render sink targeting window.

Parameters
sinksSink vector owned by the calling Emitter or Agent.
mgrBufferManager the VKBuffer was registered with.
windowWindow passed to add_render_sink().

Definition at line 186 of file Sinks.cpp.

190{
191 auto it = std::ranges::find_if(sinks,
192 [&window](const RenderSink& s) { return s.window == window; });
193
194 if (it == sinks.end()) {
195 MF_WARN(Journal::Component::Buffers, Journal::Context::Init,
196 "Nexus: remove_render_sink called but no sink found for given window");
197 return;
198 }
199
200 mgr.remove_buffer(it->buf, Buffers::ProcessingToken::GRAPHICS_BACKEND);
201 sinks.erase(it);
202
203 MF_DEBUG(Journal::Component::Buffers, Journal::Context::Init,
204 "Nexus: render sink removed");
205}
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
void remove_buffer(const std::shared_ptr< Buffer > &buffer, ProcessingToken token, uint32_t channel=0)
Removes a buffer from a token.
std::shared_ptr< Core::Window > window
Definition Sinks.hpp:69
Holds the plumbing for one graphics output registered from a Nexus object.
Definition Sinks.hpp:63

References MayaFlux::Journal::Buffers, MayaFlux::Buffers::GRAPHICS_BACKEND, MayaFlux::Journal::Init, MF_DEBUG, MF_WARN, MayaFlux::Buffers::BufferManager::remove_buffer(), and MayaFlux::Nexus::RenderSink::window.

Referenced by MayaFlux::Nexus::Agent::remove_render(), and MayaFlux::Nexus::Emitter::remove_render().

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