Skip to main content

BasicWindowRenderingController.ixx File

Controller implementation for basic window rendering management. More...

Included Headers

Namespaces Index

namespacehelios
namespaceapp

Application infrastructure and lifecycle management. More...

namespacecontroller

Controller classes for application control flow. More...

Classes Index

classBasicWindowRenderingController

Basic implementation of a window rendering controller. More...

Description

Controller implementation for basic window rendering management.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file BasicWindowRenderingController.ixx
3 * @brief Controller implementation for basic window rendering management.
4 */
5module;
6
7#include <string>
8#include <format>
9
10export module helios.app.controller.BasicWindowRenderingController;
11
12import helios.app.controller.WindowRenderingController;
13
14import helios.rendering.RenderingDevice;
15import helios.window.event.FrameBufferResizeEvent;
16import helios.event.Dispatcher;
17import helios.window.Window;
18
19export namespace helios::app::controller {
20
21 /**
22 * @brief Basic implementation of a window rendering controller.
23 *
24 * This controller handles framebuffer resize events and manages rendering
25 * for a single window instance.
26 */
28
29 private:
30 /**
31 * @brief Reference to the window managed by this controller.
32 */
34
35 public:
36 /**
37 * @brief Constructs a new BasicWindowRenderingController instance.
38 *
39 * @param window Reference to the window to be managed by this controller.
40 */
42 window_(window)
43 {}
44
45 /**
46 * @brief Handles framebuffer resize events.
47 *
48 * @param e The framebuffer resize event containing the new dimensions.
49 */
51 logger_.debug(std::format("onFrameBufferResize ({0}, {1})", e.width, e.height));
52 window_.renderTarget().setSize(e.width, e.height);
53 }
54
55 /**
56 * @brief Registers this controller to the framebuffer resize event.
57 *
58 * @param dispatcher The event dispatcher to subscribe to.
59 *
60 * @see onFrameBufferResize
61 */
62 void subscribeTo(helios::event::Dispatcher& dispatcher) override {
63 logger_.debug("Subscribing to dispatcher.");
67 }
68 );
69 }
70
71 /**
72 * @brief Initializes this controller.
73 *
74 * @return True if initialization succeeded, otherwise false.
75 */
76 bool init() override {
77 return true;
78 }
79
80 [[nodiscard]] std::string toString() const noexcept override {
81 return "BasicWindowController";
82 }
83 };
84
85
86}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.