Window
The Window module provides window management functionalities of the underlying system.
Types
-
Platform-specific application startup parameters.
-
Implemented by window object on macOS platform.
-
Luna::Window::FileDialogFilter
Specifies one filter that allows the user to filter files with specified types in file dialogs.
-
Implemented by the window object if the underlying window is a GLFW window. This interface is enabled on Windows, Linux and macOS platform.
-
Describes one video mode of one monitor.
-
Luna::Window::WindowEventTouchPoint
Identifies one touch point in one window touch event.
-
Luna::Window::WindowDisplaySettings
The window display settings.
-
Represents a system window that can be used to display user interface and can be drawn as surface.
-
Implemented by window object on Windows platform.
Enumerations
-
The flags for opening one file dialog.
-
Specifies the type of the message box.
-
Specifies the icon that will be displayed on the message box.
-
Luna::Window::MessageBoxButton
Indicates buttons on the message box.
-
Identifies keys that are pressed in window mouse events.
-
Luna::Window::WindowCreationFlag
Flags that specifies the initial state and style of the window.
Alias types
-
The opaque handle that represents the system moditor.
-
using window_close_event_handler_t = void(IWindow* window)
The hanlder for window close event.
-
using window_focus_event_handler_t = void(IWindow* window)
The handler for window focus event.
-
using window_lose_focus_event_handler_t = void(IWindow* window)
The handler for window lose foucs event.
-
using window_show_event_handler_t = void(IWindow* window)
The handler for window show event.
-
using window_hide_event_handler_t = void(IWindow* window)
The handler for window hide event.
-
using window_resize_event_handler_t = void(IWindow* window, u32 width, u32 height)
The handler for window resize event.
-
using window_framebuffer_resize_event_handler_t = void(IWindow* window, u32 width, u32 height)
The handler for window framebuffer resize event.
-
using window_move_event_handler_t = void(IWindow* window, i32 x, i32 y)
The handler for window move resize event.
-
using window_begin_resize_move_t = void(IWindow* window)
The handler for window begin resize move event.
-
using window_end_resize_move_t = void(IWindow* window)
The handler for window end resize move event.
-
using window_dpi_changed_event_handler_t = void(IWindow* window, f32 dpi_scale)
The handler for window dpi changed event.
-
using window_key_down_event_handler_t = void(IWindow* window, HID::KeyCode key)
The handler for window key down event.
-
using window_key_up_event_handler_t = void(IWindow* window, HID::KeyCode key)
The handler for window key up event.
-
using window_input_character_event_handler_t = void(IWindow* window, c32 character)
The handler for window input character event.
-
using window_mouse_move_event_handler_t = void(IWindow* window, i32 x, i32 y)
The handler for mouse move event.
-
The handler for mouse down event.
-
The handler for mouse up event.
-
The handler for mouse up event.
-
using window_touch_event_handler_t = void(IWindow* window, Span
touches, u32 changed_mask) The handler for touch event.
-
using window_drop_file_event_handler_t = void(IWindow* window, i32 x, i32 y, Span
paths) The handler for drop file event.
Constants
-
Specify this value as
x
ory
of the window to let windowing system choose one suitable position for the window.
Functions
-
void set_startup_params(const StartupParams ¶ms)
Sets the startup parameters for Window module. This should be called before the Window module is initialized.
-
Gets the application name.
-
Gets the application version.
-
Displays one open file dialog and fetches the selecting results.
-
Displays one save file dialog and fetches the selecting results.
-
R< Path > open_dir_dialog(const c8 *title=nullptr, const Path &initial_dir=Path())
Displays one open directory dialog and fetches the selecting results.
-
Displays one message box dialog. The current thread blocks until the dialog is closed.
-
monitor_t get_primary_monitor()
Gets the primary monitor of the platform.
-
Gets the number of monitors currently connected to the platform.
-
monitor_t get_monitor(u32 index)
Gets the monitor at specified index.
-
Event< monitor_event_handler_t > & get_monitor_event()
Gets the event that will be called when one monitor event is triggered.
-
u32 count_monitor_supported_video_modes(monitor_t monitor)
Gets the number of supported video modes of the monitor.
-
VideoMode get_monitor_supported_video_mode(monitor_t monitor, u32 index)
Gets the supported video mode of the monitor at the specified index.
-
VideoMode get_monitor_video_mode(monitor_t monitor)
Gets the current video mode of the monitor.
-
UInt2U get_monitor_physical_size(monitor_t monitor)
Gets the physical size of the monitor measured in millimetres.
-
f32 get_monitor_dpi_scale_factor(monitor_t monitor)
Gets the DPI scale factor of the monitor.
-
Int2U get_monitor_position(monitor_t monitor)
Gets the virtual position of the monitor in screen coordinates.
-
RectI get_monitor_working_area(monitor_t monitor)
Gets the working area of the monitor, that is, the area not occupied by the system UI like taskbars or menu bars.
-
Name get_monitor_name(monitor_t monitor)
Gets the name of the monitor.
-
R< VkSurfaceKHR > new_vulkan_surface_from_window(VkInstance instance, IWindow *window)
Creates a vulkan surface form window.
-
Span< const c8 * > get_required_vulkan_instance_extensions()
Gets an array of vulkan instance extensions required by the window module to create vulkan surface from IWindow.
-
void poll_events(bool wait_events=false)
Processes window events for all windows created from the current thread.
-
Creates one new window. The new window will be displayed immediately unless WindowCreationFlag::hidden is set.