pub trait KhoraWindow:
HasWindowHandle
+ HasDisplayHandle
+ Send
+ Sync {
// Required methods
fn inner_size(&self) -> (u32, u32);
fn scale_factor(&self) -> f64;
fn request_redraw(&self);
fn clone_handle_arc(&self) -> KhoraWindowHandle;
fn id(&self) -> u64;
}
Expand description
A trait that abstracts the behavior of an application window.
This is the primary contract for windowing integration in Khora. Any windowing
backend (like the Winit implementation in khora-infra
) must implement this trait
to be usable by the engine’s rendering and input systems.
Required Methods§
Sourcefn inner_size(&self) -> (u32, u32)
fn inner_size(&self) -> (u32, u32)
Returns the physical dimensions (width, height) in pixels of the window’s inner client area.
Sourcefn scale_factor(&self) -> f64
fn scale_factor(&self) -> f64
Returns the display’s scale factor, used for HiDPI rendering.
Sourcefn request_redraw(&self)
fn request_redraw(&self)
Requests that the operating system schedule a redraw for the window.
Sourcefn clone_handle_arc(&self) -> KhoraWindowHandle
fn clone_handle_arc(&self) -> KhoraWindowHandle
Clones a thread-safe, reference-counted handle to the window.
This is the primary mechanism for the renderer to obtain a handle it can use to create a render surface, without needing to know the concrete window type.