Class Controllers
Abstract base class for all controllers in the Editor layer. More...
#include <Controllers.h>
Inherited by the following classes: CameraController, ShaderController, ViewportController
Public Functions
| Type | Name |
|---|---|
| virtual void | bind (EventPool & pool) = 0 Subscribe to relevant events in the EventPool . |
Detailed Description
Controllers encapsulate domain-specific application logic that responds to Events emitted by the UI or other systems. They subscribe to relevant events via the EventPool during initialization and update scene state accordingly.
Lifecycle: * Controller is instantiated by ControllerManager * bind() is called to subscribe to EventPool * Event handlers react to user actions or state changes * Controller mutates scene objects via direct access or additional events
Design Constraints: * Controllers MUST NOT hold GPU resources * Controllers MUST NOT directly call OpenGL functions * Controllers SHOULD be stateless or minimize internal state * Controllers communicate via Events for cross-domain coordination
Note:
Pure abstract base class - all controllers must implement bind().
Public Functions Documentation
function bind
Subscribe to relevant events in the EventPool .
virtual void Controllers::bind (
EventPool & pool
) = 0
This method is called once during controller initialization to establish event subscriptions. Controllers should subscribe to all events they need to handle their domain logic (e.g., CameraController subscribes to mouse drag).
Event handlers typically: * Validate event data * Update scene objects (Transform, Material, etc.) * Emit secondary events to notify other systems
Parameters:
poolThe EventPool to bind subscriptions to
Note:
This is called before any events are emitted, ensuring handlers are ready.
Note:
Subscriptions persist for the lifetime of the controller.
The documentation for this class was generated from the following file src/editor/Controllers.h