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

◆ remove_render_sink()

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 194 of file Sinks.cpp.

198{
199 auto it = std::ranges::find_if(sinks,
200 [&window](const RenderSink& s) { return s.window == window; });
201
202 if (it == sinks.end()) {
203 MF_WARN(Journal::Component::Buffers, Journal::Context::Init,
204 "Nexus: remove_render_sink called but no sink found for given window");
205 return;
206 }
207
208 mgr.remove_buffer(it->buf, Buffers::ProcessingToken::GRAPHICS_BACKEND);
209 sinks.erase(it);
210
211 MF_DEBUG(Journal::Component::Buffers, Journal::Context::Init,
212 "Nexus: render sink removed");
213}
#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:71
Holds the plumbing for one graphics output registered from a Nexus object.
Definition Sinks.hpp:65

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: