procmod-overlay 3.0.0

Game overlay rendering with transparent click-through windows
Documentation
use thiserror::Error;

#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
    #[error("target window not found")]
    WindowNotFound,

    #[error("target process does not exist: {pid}")]
    ProcessNotFound { pid: u32 },

    #[error("process {pid} has no visible top-level window on the current desktop")]
    ProcessWindowNotFound { pid: u32 },

    #[error("overlay window closed")]
    OverlayClosed,

    #[error("target window was lost")]
    TargetWindowLost,

    #[error("failed to create overlay window")]
    WindowCreation(#[source] std::io::Error),

    #[error("failed to create D3D11 device")]
    DeviceCreation,

    #[error("failed to create swap chain")]
    SwapChainCreation,

    #[error("failed to compile shader: {message}")]
    ShaderCompilation { message: String },

    #[error("failed to create render target")]
    RenderTarget,

    #[error("renderer error: {message}")]
    Renderer { message: String },

    /// The graphics device was lost and could not be rebuilt.
    ///
    /// A lost device is normally repaired during the next `begin_frame` without the
    /// application seeing an error. This reports the case where the replacement device
    /// could not be created, which usually means the adapter is gone for good.
    #[error("graphics device was lost and could not be rebuilt (0x{reason:08X})")]
    DeviceLost { reason: u32 },

    #[error("frame not in progress")]
    NoActiveFrame,
}

pub type Result<T> = std::result::Result<T, Error>;