You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
696 B
Rust
32 lines
696 B
Rust
use image::ImageError;
|
|
use std::ffi::NulError;
|
|
use std::str::Utf8Error;
|
|
|
|
#[derive(Debug)]
|
|
pub enum Error {
|
|
ShaderContainsNul(NulError),
|
|
ShaderCompilationFailure(String),
|
|
ShaderProgramLinkFailure(String),
|
|
InfoLogEncodingError(Utf8Error),
|
|
TextureLoadError(ImageError),
|
|
TextureParseError,
|
|
}
|
|
|
|
impl From<Utf8Error> for Error {
|
|
fn from(utf8err: Utf8Error) -> Self {
|
|
Error::InfoLogEncodingError(utf8err)
|
|
}
|
|
}
|
|
|
|
impl From<NulError> for Error {
|
|
fn from(nul_err: NulError) -> Self {
|
|
Error::ShaderContainsNul(nul_err)
|
|
}
|
|
}
|
|
|
|
impl From<ImageError> for Error {
|
|
fn from(image_err: ImageError) -> Self {
|
|
Error::TextureLoadError(image_err)
|
|
}
|
|
}
|