class RenderWindowManager

Handles creation and internal updates relating to render windows.

Public

Constructors

RenderWindowManager

RenderWindowManager() = default

Methods

~RenderWindowManager

~RenderWindowManager() noexcept = default

CreateRenderWindow

SPtr<RenderWindow> CreateRenderWindow(const RenderWindowCreateInformation &createInformation, const SPtr<RenderWindow> &parentWindow)

Creates a new render window using the specified options.

Optionally makes the created window a child of another window.

CreateRenderWindowSurface

virtual SPtr<render::IRenderWindowSurface> CreateRenderWindowSurface(const render::RenderWindowSurfaceCreateInformation &createInformation) = 0

Creates a render window surface that is appropriate for the currently active platform & GPU backend combination.

Thread safe.

Update

void Update()

Called once per frame.

Dispatches events.

NotifyWindowDestroyed

void NotifyWindowDestroyed(RenderWindow &window)

Called by the main thread when window is destroyed.

NotifyFocusReceived

void NotifyFocusReceived(RenderWindow &window)

Called by the main thread when window receives focus.

NotifyFocusLost

void NotifyFocusLost(RenderWindow &window)

Called by the main thread when window loses focus.

NotifyMouseLeft

void NotifyMouseLeft(RenderWindow &window)

Called by the main thread when mouse leaves a window.

RequestShowWindow

void RequestShowWindow(u32 windowId, bool show)

Requests a window to be shown or hidden.

Expected to be called from non-main thread, otherwise you can call this directly on the render window.

GetRenderWindows

Vector<RenderWindow *> GetRenderWindows() const

Returns a list of all open render windows.

GetTopMostModal

RenderWindow *GetTopMostModal() const

Returns the window that is currently the top-most modal window.

Returns null if no modal windows are active.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Fields

OnFocusGained

Event<void (RenderWindow &)> OnFocusGained

Event that is triggered when a window gains focus.

OnFocusLost

Event<void (RenderWindow &)> OnFocusLost

Event that is triggered when a window loses focus.

OnMouseLeftWindow

Event<void (RenderWindow &)> OnMouseLeftWindow

Event that is triggered when mouse leaves a window.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Fields

mWindows

Map<u32, RenderWindow *> mWindows

mModalWindowStack

Vector<RenderWindow *> mModalWindowStack

mWindowInFocus

RenderWindow * mWindowInFocus

mNextWindowId

u32 mNextWindowId