MayaFlux 0.5.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 183 of file Sinks.cpp.

187{
188 auto it = std::ranges::find_if(sinks,
189 [&window](const RenderSink& s) { return s.window == window; });
190
191 if (it == sinks.end()) {
192 MF_WARN(Journal::Component::Buffers, Journal::Context::Init,
193 "Nexus: remove_render_sink called but no sink found for given window");
194 return;
195 }
196
197 mgr.remove_buffer(it->buf, Buffers::ProcessingToken::GRAPHICS_BACKEND);
198 sinks.erase(it);
199
200 MF_DEBUG(Journal::Component::Buffers, Journal::Context::Init,
201 "Nexus: render sink removed");
202}
#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: