mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
Add CreationError::NoAvailablePixelFormat
This commit is contained in:
@@ -603,7 +603,7 @@ impl Window {
|
||||
Err(CreationError::NotSupported)
|
||||
}
|
||||
} else {
|
||||
Err(CreationError::NotSupported)
|
||||
Err(CreationError::NoAvailablePixelFormat)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -573,5 +573,5 @@ fn choose_dummy_pixel_format<I>(iter: I) -> Result<libc::c_int, CreationError>
|
||||
}
|
||||
}
|
||||
|
||||
backup_id.ok_or(CreationError::NotSupported)
|
||||
backup_id.ok_or(CreationError::OsError("No available pixel format".to_string()))
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ pub enum CreationError {
|
||||
NotSupported,
|
||||
RobustnessNotSupported,
|
||||
OpenGlVersionNotSupported,
|
||||
NoAvailablePixelFormat,
|
||||
}
|
||||
|
||||
impl CreationError {
|
||||
@@ -122,6 +123,8 @@ impl CreationError {
|
||||
not supported.",
|
||||
CreationError::OpenGlVersionNotSupported => "The requested OpenGL version is not \
|
||||
supported.",
|
||||
CreationError::NoAvailablePixelFormat => "Couldn't find any pixel format that matches \
|
||||
the criterias.",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -471,7 +474,7 @@ impl<'a> BuilderAttribs<'a> {
|
||||
}
|
||||
|
||||
current_result.or(current_software_result)
|
||||
.ok_or(CreationError::NotSupported)
|
||||
.ok_or(CreationError::NoAvailablePixelFormat)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user