MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Core::GlfwWindow Class Reference

Platform-agnostic window wrapper. More...

#include <GlfwWindow.hpp>

+ Inheritance diagram for MayaFlux::Core::GlfwWindow:
+ Collaboration diagram for MayaFlux::Core::GlfwWindow:

Public Member Functions

 GlfwWindow (const WindowCreateInfo &create_info, const GraphicsSurfaceInfo &surface_info, GlobalGraphicsConfig::GraphicsApi api, GlfwPreInitConfig pre_init_config={})
 Creates a window with the given configuration.
 
 ~GlfwWindow () override
 
 GlfwWindow (const GlfwWindow &)=delete
 
GlfwWindowoperator= (const GlfwWindow &)=delete
 
 GlfwWindow (GlfwWindow &&) noexcept
 
GlfwWindowoperator= (GlfwWindow &&) noexcept
 
void show () override
 Show the window.
 
void hide () override
 Hide the window.
 
bool should_close () const override
 Poll for window events (non-blocking)
 
const WindowStateget_state () const override
 Get the current window state.
 
const WindowCreateInfoget_create_info () const override
 
void set_input_config (const InputConfig &config) override
 Set input configuration (keyboard, mouse, cursor)
 
const InputConfigget_input_config () const override
 Get current input configuration.
 
void set_event_callback (WindowEventCallback callback) override
 Set the callback function for window events.
 
void * get_native_handle () const override
 Get native window handle (platform-specific)
 
void * get_native_display () const override
 Get native display handle (platform-specific)
 
GLFWwindow * get_glfw_handle () const
 
void set_title (const std::string &title) override
 Set window title, size, or position.
 
void set_size (uint32_t width, uint32_t height) override
 Resize the window.
 
void set_position (uint32_t x, uint32_t y) override
 Move the window to a new position.
 
Vruta::EventSourceget_event_source () override
 Gets the event source for awaiting events.
 
const Vruta::EventSourceget_event_source () const override
 
bool is_graphics_registered () const override
 Check if window is registered with graphics subsystem.
 
void set_graphics_registered (bool registered) override
 Mark window as registered/unregistered with graphics Called by GraphicsSubsystem during register/unregister.
 
- Public Member Functions inherited from MayaFlux::Core::Window
virtual ~Window ()=default
 

Private Member Functions

void configure_window_hints (const GraphicsSurfaceInfo &surface_info, GlobalGraphicsConfig::GraphicsApi api) const
 
void setup_callbacks ()
 

Static Private Member Functions

static void glfw_window_size_callback (GLFWwindow *window, int width, int height)
 
static void glfw_window_close_callback (GLFWwindow *window)
 
static void glfw_window_focus_callback (GLFWwindow *window, int focused)
 
static void glfw_framebuffer_size_callback (GLFWwindow *window, int width, int height)
 
static void glfw_key_callback (GLFWwindow *window, int key, int scancode, int action, int mods)
 
static void glfw_cursor_pos_callback (GLFWwindow *window, double xpos, double ypos)
 
static void glfw_mouse_button_callback (GLFWwindow *window, int button, int action, int mods)
 
static void glfw_scroll_callback (GLFWwindow *window, double xoffset, double yoffset)
 

Private Attributes

GLFWwindow * m_window = nullptr
 
WindowCreateInfo m_create_info
 
WindowState m_state
 
InputConfig m_input_config
 
WindowEventCallback m_event_callback
 
std::atomic< bool > m_graphics_registered { false }
 
Vruta::EventSource m_event_source
 

Detailed Description

Platform-agnostic window wrapper.

Wraps a GLFW window and provides a unified interface for window management, event handling, and state tracking.

Definition at line 16 of file GlfwWindow.hpp.


The documentation for this class was generated from the following files: