Merge #19
This commit is contained in:
parent
afab881559
commit
4075536745
4 changed files with 678 additions and 659 deletions
37
src/error.rs
Normal file
37
src/error.rs
Normal file
|
@ -0,0 +1,37 @@
|
|||
use std::{
|
||||
error::Error,
|
||||
fmt::{self, Display, Formatter},
|
||||
};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum PrepareError {
|
||||
AtlasFull,
|
||||
}
|
||||
|
||||
impl Display for PrepareError {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
write!(f, "Prepare Error: The Glyph texture atlas is full.")
|
||||
}
|
||||
}
|
||||
|
||||
impl Error for PrepareError {}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum RenderError {
|
||||
RemovedFromAtlas,
|
||||
ScreenResolutionChanged,
|
||||
}
|
||||
|
||||
impl Display for RenderError {
|
||||
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
|
||||
match self {
|
||||
RenderError::RemovedFromAtlas => {
|
||||
write!(f, "Render Error: Glyph no longer Exists within the Atlas.")
|
||||
}
|
||||
RenderError::ScreenResolutionChanged => write!(
|
||||
f,
|
||||
"Render Error: Screen resolution changed since prepare was last executed."
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue