You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
492 B

pub mod ctx;
pub mod evt;
pub mod win;
mod sdl;
#[derive(thiserror::Error, Debug)]
#[non_exhaustive]
pub enum Err {
#[error("SDL Error: {0}")]
Sdl(std::borrow::Cow<'static, str>),
}
impl Err {
/// Creates an `Err` from the current SDL error.
///
/// # Safety
///
/// This function will cause undefined behaviour if used from
/// multiple threads.
unsafe fn new_sdl() -> Self {
Self::Sdl(unsafe {
std::ffi::CStr::from_ptr(sdl::get_error()).to_string_lossy()
})
}
}
// EOF