8#include "ncengine/type/EngineId.h"
10#include "ncengine/window/IOnResizeReceiver.h"
21struct ProjectSettings;
22struct GraphicsSettings;
112 GLFWwindow* m_window;
119 bool isGraphicsEnabled,
120 Signal<>& quit) -> std::unique_ptr<NcWindow>;
auto GetDimensions() -> Vector2
Get the window dimensions.
auto ToNormalizedDeviceCoordinates(const Vector2 &screenCoordinates) -> Vector2
Convert screen space coordinates to normalized device coordinates (in the range [-1,...
void UnregisterOnResizeReceiver(IOnResizeReceiver *receiver) noexcept
Unregister an object from receiving window resize events.
auto BuildWindowModule(const config::ProjectSettings &projectSettings, bool isGraphicsEnabled, Signal<> &quit) -> std::unique_ptr< NcWindow >
Build an NcWindow module instance.
auto GetScreenExtent() -> Vector2
Get the dimensions of the screen after aspect ratio transformations.
auto GetContentScale() -> Vector2
Get the current DPI.
void RegisterOnResizeReceiver(IOnResizeReceiver *receiver)
Allow an object to receive window resize events. Receivers must be unregistered before they are destr...
Modules are extensions that provide functionality to the engine.
Definition: Module.h:19
An event source supporting multiple Connections.
Definition: Signal.h:65
Definition: IOnResizeReceiver.h:8
Window module interface.
Definition: Window.h:67
virtual void ProcessSystemMessages()=0
Process window and input events.
auto OnResize() noexcept -> Signal< const Vector2 &, bool > &
Get the Signal for window resize events.
Definition: Window.h:88
auto OnViewportResize() noexcept -> Signal< const Viewport & > &
Get the Signal for viewport resize events.
Definition: Window.h:91
virtual void SetWindow(WindowInfo windowInfo)=0
Set the window for the module.
virtual void SetViewport(const Viewport &viewport)=0
Set the dimensions and position of the renderable window. Values must be between [0....
void OnBeforeSceneLoad(const Scene &) override
Called on registered modules prior to loading a new scene.
Definition: Window.h:73
auto GetContentScale() const noexcept -> const Vector2 &
Get the ratio between the current DPI and the platform's default DPI.
Definition: Window.h:82
auto GetWindowHandle() const noexcept -> GLFWwindow *
Get the GLFW window handle.
Definition: Window.h:85
auto GetScreenExtent() const noexcept -> const Vector2 &
Get the dimensions of the renderable window region.
Definition: Window.h:79
auto GetDimensions() const noexcept -> const Vector2 &
Get the dimensions of the entire window.
Definition: Window.h:76
A two component vector.
Definition: Vector.h:13
A struct that controls the viewport and scissor size and placement.
Definition: WindowTypes.h:16
General project options.
Definition: Config.h:14
The window's create info.
Definition: Window.h:55
bool isResizable
True if the window is resizable.
Definition: Window.h:60
bool launchInFullScreen
True if the window should launch in full screen.
Definition: Window.h:59
bool isHeadless
True if this is a headless window. Still receives input events.
Definition: Window.h:57
bool useNativeResolution
True if the window should use the monitor's native resolution.
Definition: Window.h:58
Vector2 dimensions
The window's dimensions.
Definition: Window.h:56