From 1e62fdf069db5687be510e1cc375260bbff318a7 Mon Sep 17 00:00:00 2001 From: Richard Date: Thu, 27 Jan 2022 04:00:53 -0300 Subject: Introduce `Error::ContextCreationFailed` --- glutin/src/application.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'glutin/src/application.rs') 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()), + ), } })?; -- cgit