Skip to main content

BasicWindowRenderingController Class

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

Declaration

class helios::app::controller::BasicWindowRenderingController { ... }

Base class

classWindowRenderingController

Abstract base controller for handling window related events. More...

Public Constructors Index

BasicWindowRenderingController (helios::window::Window &window)

Constructs a new BasicWindowRenderingController instance. More...

Public Member Functions Index

voidonFrameBufferResize (const helios::window::event::FrameBufferResizeEvent &e) override

Handles framebuffer resize events. More...

voidsubscribeTo (helios::event::Dispatcher &dispatcher) override

Registers this controller to the framebuffer resize event. More...

boolinit () override

Initializes this controller. More...

std::stringtoString () const noexcept override

Private Member Attributes Index

helios::window::Window &window_

Reference to the window managed by this controller. More...

Description

Basic implementation of a window rendering controller.

This controller handles framebuffer resize events and manages rendering for a single window instance.

Definition at line 27 of file BasicWindowRenderingController.ixx.

Public Constructors

BasicWindowRenderingController()

helios::app::controller::BasicWindowRenderingController::BasicWindowRenderingController (helios::window::Window & window)
inline explicit

Constructs a new BasicWindowRenderingController instance.

Parameters
window

Reference to the window to be managed by this controller.

Definition at line 41 of file BasicWindowRenderingController.ixx.

Public Member Functions

init()

bool helios::app::controller::BasicWindowRenderingController::init ()
inline virtual

Initializes this controller.

Returns

True if initialization succeeded, otherwise false.

Definition at line 76 of file BasicWindowRenderingController.ixx.

76 bool init() override {
77 return true;
78 }

onFrameBufferResize()

void helios::app::controller::BasicWindowRenderingController::onFrameBufferResize (const helios::window::event::FrameBufferResizeEvent & e)
inline virtual

Handles framebuffer resize events.

Parameters
e

The framebuffer resize event containing the new dimensions.

Definition at line 50 of file BasicWindowRenderingController.ixx.

51 logger_.debug(std::format("onFrameBufferResize ({0}, {1})", e.width, e.height));
52 window_.renderTarget().setSize(e.width, e.height);
53 }

References helios::window::event::FrameBufferResizeEvent::height, helios::app::controller::WindowRenderingController::logger_ and helios::window::event::FrameBufferResizeEvent::width.

Referenced by subscribeTo.

subscribeTo()

void helios::app::controller::BasicWindowRenderingController::subscribeTo (helios::event::Dispatcher & dispatcher)
inline virtual

Registers this controller to the framebuffer resize event.

Parameters
dispatcher

The event dispatcher to subscribe to.

See Also

onFrameBufferResize

Definition at line 62 of file BasicWindowRenderingController.ixx.

62 void subscribeTo(helios::event::Dispatcher& dispatcher) override {
63 logger_.debug("Subscribing to dispatcher.");
67 }
68 );
69 }

References helios::app::controller::WindowRenderingController::logger_, onFrameBufferResize and helios::event::Dispatcher::subscribe.

toString()

std::string helios::app::controller::BasicWindowRenderingController::toString ()
inline nodiscard noexcept virtual

Definition at line 80 of file BasicWindowRenderingController.ixx.

80 [[nodiscard]] std::string toString() const noexcept override {
81 return "BasicWindowController";
82 }

Private Member Attributes

window_

helios::window::Window& helios::app::controller::BasicWindowRenderingController::window_

Reference to the window managed by this controller.

Definition at line 33 of file BasicWindowRenderingController.ixx.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.