byte-engine-ghi 0.1.0

Graphics hardware interface layer used by Byte-Engine.
#[cfg(target_os = "linux")]
pub mod wayland;
#[cfg(target_os = "linux")]
pub use wayland::Handles;
#[cfg(target_os = "linux")]
pub use wayland::Window;

#[cfg(target_os = "windows")]
pub mod win32;
#[cfg(target_os = "windows")]
pub use win32::Handles;
#[cfg(target_os = "windows")]
pub use win32::Window;

#[cfg(target_os = "macos")]
pub mod macos;
#[cfg(target_os = "macos")]
pub use macos::Handles;
#[cfg(target_os = "macos")]
pub use macos::Window;

use crate::window::{Events, Features};

pub trait WindowLike: Sized {
	/// Creates a window with the given name, extent, application ID, and features.
	fn try_new(name: &str, extent: utils::Extent, id_name: &str, features: Features) -> Result<Self, String>;

	fn poll<'a>(&'a mut self) -> impl Iterator<Item = Events> + 'a;

	fn handles(&self) -> Handles;

	fn show_cursor(&mut self, show: bool);
	fn confine_cursor(&mut self, confine: bool);
}