Trait KhoraWindow

Source
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§

Source

fn inner_size(&self) -> (u32, u32)

Returns the physical dimensions (width, height) in pixels of the window’s inner client area.

Source

fn scale_factor(&self) -> f64

Returns the display’s scale factor, used for HiDPI rendering.

Source

fn request_redraw(&self)

Requests that the operating system schedule a redraw for the window.

Source

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.

Source

fn id(&self) -> u64

Returns a unique identifier for the window.

Implementors§