Introduce Error::ContextCreationFailed
This commit is contained in:
parent
a33e320521
commit
1e62fdf069
5 changed files with 39 additions and 18 deletions
|
|
@ -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()),
|
||||
),
|
||||
}
|
||||
})?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue