sable-platform 0.1.0

Platform abstraction layer for Sable Engine - windowing, input, and events
Documentation
//! Error types for the platform crate.

use thiserror::Error;

/// Platform-specific errors.
#[derive(Debug, Error)]
pub enum PlatformError {
    /// Failed to create event loop.
    #[error("failed to create event loop: {0}")]
    EventLoopCreation(#[from] winit::error::EventLoopError),

    /// Failed to create window.
    #[error("failed to create window: {0}")]
    WindowCreation(#[from] winit::error::OsError),

    /// Window has been closed or is no longer valid.
    #[error("window is no longer valid")]
    WindowInvalid,

    /// Surface handle error.
    #[error("failed to get surface handle: {0}")]
    SurfaceHandle(#[from] raw_window_handle::HandleError),
}

/// Result type alias for platform operations.
pub type Result<T> = std::result::Result<T, PlatformError>;