Introduce Error::ContextCreationFailed

This commit is contained in:
Richard 2022-01-27 04:00:53 -03:00
parent a33e320521
commit 1e62fdf069
5 changed files with 39 additions and 18 deletions

View file

@ -1,7 +1,19 @@
/// A graphical error that occurred while running an application.
/// An error that occurred while creating an application's graphical context.
#[derive(Debug, thiserror::Error)]
pub enum Error {
/// A suitable graphics adapter or device could not be found
/// The requested backend version is not supported.
#[error("the requested backend version is not supported")]
VersionNotSupported,
/// Failed to find any pixel format that matches the criteria.
#[error("failed to find any pixel format that matches the criteria")]
NoAvailablePixelFormat,
/// A suitable graphics adapter or device could not be found.
#[error("a suitable graphics adapter or device could not be found")]
AdapterNotFound,
GraphicsAdapterNotFound,
/// An error occured in the context's internal backend
#[error("an error occured in the context's internal backend")]
BackendError(String),
}