Class Viewport¶
Defined in File viewport.h
Class Documentation¶
-
class Viewport¶
Editor viewport that renders the scene to a separate render target displayed in ImGui.
The Viewport class renders the scene to its own RenderTarget instead of directly to the swapchain. This rendered image is then displayed as an ImGui::Image within a “Viewport” window.
Public Functions
-
Viewport(const renderer::vulkan::VulkanSwapchain &swapchain, RuntimeModule &runtime_module)¶
Constructs a Viewport with initial dimensions from the swapchain.
- Parameters:
swapchain – Used to determine initial viewport size and color format.
runtime_module – The runtime module that handles scene rendering.
-
~Viewport()¶
-
void on_gui_update(const FrameContext &frame)¶
Renders the viewport image in an ImGui window.
Handles viewport resizing when the ImGui window size changes, recreating the render target and updating the descriptor set as needed.
- Parameters:
frame – The current frame context.
-
void render(FrameContext &frame) const¶
Renders the scene to the viewport’s render target.
- Parameters:
frame – The current frame context.
-
Viewport(const renderer::vulkan::VulkanSwapchain &swapchain, RuntimeModule &runtime_module)¶