8#ifndef GALAXY_CORE_WINDOW_HPP_
9#define GALAXY_CORE_WINDOW_HPP_
11#include <entt/signal/fwd.hpp>
13#include <GLFW/glfw3.h>
15#include "galaxy/core/WindowSettings.hpp"
17#include "galaxy/input/Cursor.hpp"
76 void resize(
const int width,
const int height);
115 void set_title(
const std::string& title);
129 void set_icon(
const std::string& icon);
136 void set_icon(std::span<std::uint8_t> buffer);
171 template<meta::is_input_device Device>
313 template<meta::is_input_device Device>
316 if constexpr (std::is_same<Device, input::Keyboard>::value)
320 else if constexpr (std::is_same<Device, input::Mouse>::value)
324 else if constexpr (std::is_same<Device, input::Cursor>::value)
328 else if constexpr (std::is_same<Device, input::Clipboard>::value)
Handles events, input & display.
input::Keyboard m_keyboard
Keyboard assigned to window.
void set_title(const std::string &title)
Set window title.
std::string m_title
Window title.
void destroy()
Destroys Window and related context and data.
int m_window_height
Height of window (or fullscreen).
meta::vector< std::string > m_drop_paths
Cache of last dropped paths.
Device & get_input()
Get a window input device.
void poll_events()
Poll for events.
input::Clipboard m_clipboard
Clipboard access.
input::Cursor m_cursor
Mouse cursor.
void append_title(const std::string &append)
Append to window title.
int window_height() const
void minimize() const
Minimize window.
Window()=delete
Constructor.
void close()
Closes the current window.
glm::vec2 get_content_scale()
Get window content scale.
float get_content_scale_max()
Get max window content scale.
Window & operator=(const Window &)=delete
Copy assignment operator.
float m_aspect_ratio
Window aspect ratio.
bool is_focused() const
Check if windows is in focus.
glm::ivec2 get_framebuffer_size()
Get framebuffer size taking into account DPI.
float aspect_ratio() const
Window & operator=(Window &&)=delete
Move assignment operator.
bool is_open() const
Checks if window is currently open or not.
void request_attention()
Notify's user of an event without interrupting.
entt::dispatcher * m_dispatcher
Currently active event dispatcher.
void focus() const
Force window into focus.
void set_icon(const std::string &icon)
Set window icon.
GLFWwindow * m_window
GLFW window data.
input::Mouse m_mouse
Mouse assigned to window.
Window(Window &&)=delete
Move constructor.
int m_frame_height
The virtual or final framebuffer height.
void restore()
Restore window.
int m_frame_width
The virtual or final framebuffer width.
void resize(const int width, const int height)
Resizes window.
int m_window_width
Width of window (or fullscreen).
void set_dispatcher(entt::dispatcher *dispatcher)
Set current event dispatcher to use.
void maximize()
Maximize window.
GLFWwindow * handle()
Retrieve pointer to GLFWwindow object.
const meta::vector< std::string > & get_drop_paths() const
Get a list of paths dropped on window.
Window(const Window &)=delete
Copy constructor.
GLFWallocator m_glfw_allocator
Custom GLFW window allocator.
void fullscreen()
Set window into borderless fullscreen mode.
Holds window related settings.