summaryrefslogtreecommitdiffstats
path: root/glutin
diff options
context:
space:
mode:
authorLibravatar Richard <richardsoncusto@gmail.com>2022-01-27 04:00:53 -0300
committerLibravatar Richard <richardsoncusto@gmail.com>2022-04-20 19:57:59 -0300
commit1e62fdf069db5687be510e1cc375260bbff318a7 (patch)
treeb55e0db435c12bc31bda3bd7bcfe1908bcef32e0 /glutin
parenta33e320521fa0f08704bcea541ca337d0f45449e (diff)
downloadiced-1e62fdf069db5687be510e1cc375260bbff318a7.tar.gz
iced-1e62fdf069db5687be510e1cc375260bbff318a7.tar.bz2
iced-1e62fdf069db5687be510e1cc375260bbff318a7.zip
Introduce `Error::ContextCreationFailed`
Diffstat (limited to 'glutin')
-rw-r--r--glutin/src/application.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/glutin/src/application.rs b/glutin/src/application.rs
index 27a932fc..146b234e 100644
--- a/glutin/src/application.rs
+++ b/glutin/src/application.rs
@@ -80,12 +80,25 @@ where
.or_else(|_| second_builder.build_windowed(builder, &event_loop))
.map_err(|error| {
use glutin::CreationError;
+ use iced_graphics::Error as ContextError;
match error {
CreationError::Window(error) => {
Error::WindowCreationFailed(error)
}
- _ => Error::GraphicsAdapterNotFound,
+ CreationError::OpenGlVersionNotSupported => {
+ Error::ContextCreationFailed(
+ ContextError::VersionNotSupported,
+ )
+ }
+ CreationError::NoAvailablePixelFormat => {
+ Error::ContextCreationFailed(
+ ContextError::NoAvailablePixelFormat,
+ )
+ }
+ error => Error::ContextCreationFailed(
+ ContextError::BackendError(error.to_string()),
+ ),
}
})?;