Skip to main content

sable_platform/
lib.rs

1//! # Sable Platform
2//!
3//! Platform abstraction layer providing windowing, input handling, and event management.
4//!
5//! ## Modules
6//!
7//! - [`window`] — Window creation and management
8//! - [`event`] — Event loop and application events
9//! - [`input`] — Input state tracking (keyboard, mouse, gamepad)
10//!
11//! ## Quick Start
12//!
13//! ```rust,ignore
14//! use sable_platform::prelude::*;
15//!
16//! fn main() {
17//!     let event_loop = EventLoop::new().unwrap();
18//!     let window = Window::new(&event_loop, WindowConfig::default()).unwrap();
19//!
20//!     event_loop.run(|event, control_flow| {
21//!         match event {
22//!             AppEvent::CloseRequested => control_flow.exit(),
23//!             AppEvent::RedrawRequested => {
24//!                 // Render here
25//!             }
26//!             _ => {}
27//!         }
28//!     }).unwrap();
29//! }
30//! ```
31
32#![warn(missing_docs)]
33#![warn(clippy::all)]
34#![warn(clippy::pedantic)]
35#![allow(clippy::module_name_repetitions)]
36
37pub mod event;
38pub mod input;
39pub mod window;
40
41mod error;
42
43pub use error::{PlatformError, Result};
44
45/// Prelude module for convenient imports.
46pub mod prelude {
47    pub use crate::event::{AppEvent, ControlFlow, EventLoop};
48    pub use crate::input::{InputEvent, InputState, KeyCode, MouseButton};
49    pub use crate::window::{Window, WindowConfig};
50    pub use crate::{PlatformError, Result};
51}
52