1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
mod color;
mod lines;
mod noise_texture;
mod shader;

pub use color::*;
pub use lines::*;
pub use noise_texture::*;
pub use shader::*;

#[derive(Debug)]
pub enum GraphicsError {
    ShaderError(ShaderError),
    GraphicsError(solstice::GraphicsError),
}

impl std::fmt::Display for GraphicsError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
        write!(f, "{:?}", self)
    }
}

impl std::error::Error for GraphicsError {}

impl From<solstice::GraphicsError> for GraphicsError {
    fn from(err: solstice::GraphicsError) -> Self {
        GraphicsError::GraphicsError(err)
    }
}

impl From<ShaderError> for GraphicsError {
    fn from(err: ShaderError) -> Self {
        GraphicsError::ShaderError(err)
    }
}