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

◆ register_window_for_rendering()

void MayaFlux::Portal::Graphics::RenderFlow::register_window_for_rendering ( const std::shared_ptr< Core::Window > &  window,
RenderPassID  render_pass_id 
)

Associate a window with a render pass for rendering.

Parameters
windowTarget window for rendering
render_pass_idRender pass to use for this window

The window must be registered with GraphicsSubsystem first. RenderFlow will query framebuffer/extent from DisplayService when needed.

Usage: auto rp = flow.create_simple_render_pass(); flow.register_window_for_rendering(my_window, rp);

Definition at line 898 of file RenderFlow.cpp.

901{
902 if (!window) {
904 "Cannot register null window");
905 return;
906 }
907
908 auto rp_it = m_render_passes.find(render_pass_id);
909 if (rp_it == m_render_passes.end()) {
911 "Invalid render pass ID: {}", render_pass_id);
912 return;
913 }
914
915 if (!window->is_graphics_registered()) {
917 "Window '{}' not registered with graphics backend yet. "
918 "Ensure GraphicsSubsystem has registered this window.",
919 window->get_create_info().title);
920 }
921
922 if (!m_display_service->attach_render_pass(window, rp_it->second.render_pass)) {
924 "Failed to attach render pass to window '{}'",
925 window->get_create_info().title);
926 return;
927 }
928
929 WindowRenderAssociation association;
930 association.window = window;
931 association.render_pass_id = render_pass_id;
932
933 m_window_associations[window] = std::move(association);
934
936 "Registered window '{}' for rendering with render pass ID {}",
937 window->get_create_info().title,
938 render_pass_id);
939}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
std::unordered_map< RenderPassID, RenderPassState > m_render_passes
std::unordered_map< std::shared_ptr< Core::Window >, WindowRenderAssociation > m_window_associations
Registry::Service::DisplayService * m_display_service
@ Rendering
GPU rendering operations (graphics pipeline, frame rendering)
@ Portal
High-level user-facing API layer.
std::function< bool(const std::shared_ptr< void > &, const std::shared_ptr< void > &)> attach_render_pass
Attach a custom render pass to a window.

References MayaFlux::Registry::Service::DisplayService::attach_render_pass, m_display_service, m_render_passes, m_window_associations, MF_ERROR, MF_INFO, MF_WARN, MayaFlux::Journal::Portal, MayaFlux::Portal::Graphics::RenderFlow::WindowRenderAssociation::render_pass_id, MayaFlux::Journal::Rendering, and MayaFlux::Portal::Graphics::RenderFlow::WindowRenderAssociation::window.

Referenced by MayaFlux::Buffers::RenderProcessor::initialize_pipeline().

+ Here is the caller graph for this function: