fix: Allow unknown bit-depth on macOS (#4190)
It is unclear what values CGDisplayModeCopyPixelEncoding is allowed to return, so let's make sure to handle unknown cases.
This commit is contained in:
parent
3e50911adb
commit
04482d5a2e
4 changed files with 18 additions and 6 deletions
|
|
@ -151,6 +151,13 @@ impl VideoMode {
|
|||
/// Returns the bit depth of this video mode, as in how many bits you have
|
||||
/// available per color. This is generally 24 bits or 32 bits on modern
|
||||
/// systems, depending on whether the alpha channel is counted or not.
|
||||
///
|
||||
/// # Platform-specific
|
||||
///
|
||||
/// - **macOS**: Video modes do not control the bit depth of the monitor, so this often defaults
|
||||
/// to 32.
|
||||
/// - **iOS**: Always returns `None`.
|
||||
/// - **Wayland**: Always returns `None`.
|
||||
pub fn bit_depth(&self) -> Option<NonZeroU16> {
|
||||
self.bit_depth
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue