diff options
author | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2015-03-24 18:33:53 +1100 |
---|---|---|
committer | Brendan Zabarauskas <bjzaba@yahoo.com.au> | 2015-03-24 18:33:53 +1100 |
commit | 8a463f664302d90fbe31800ec25afadb1cf6d7c3 (patch) | |
tree | cc5b4782cf5204d57c60024fb6a9bb33bea65398 /src/lib.rs | |
parent | 8ad9d5fb4dfc373e69e5530961302b1990d898bf (diff) | |
parent | cf630ec0416d89bde9fcc6d8bd3674a7c55ac1a5 (diff) | |
download | glutin-8a463f664302d90fbe31800ec25afadb1cf6d7c3.tar.gz glutin-8a463f664302d90fbe31800ec25afadb1cf6d7c3.zip |
Merge pull request #316 from binsoftware/cocoa-fixes
Cocoa fixes: memory leaks, monitor handling, is_current()
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -51,6 +51,8 @@ pub use headless::{HeadlessRendererBuilder, HeadlessContext}; pub use window::{WindowBuilder, Window, WindowProxy, PollEventsIterator, WaitEventsIterator}; #[cfg(feature = "window")] pub use window::{AvailableMonitorsIter, MonitorID, get_available_monitors, get_primary_monitor}; +#[cfg(feature = "window")] +pub use native_monitor::NativeMonitorId; #[cfg(all(not(target_os = "windows"), not(target_os = "linux"), not(target_os = "macos"), not(target_os = "android")))] use this_platform_is_not_supported; @@ -324,3 +326,20 @@ impl<'a> BuilderAttribs<'a> { .expect("Could not find compliant pixel format") } } + +mod native_monitor { + /// Native platform identifier for a monitor. Different platforms use fundamentally different types + /// to represent a monitor ID. + #[derive(PartialEq, Eq)] + pub enum NativeMonitorId { + /// Cocoa and X11 use a numeric identifier to represent a monitor. + Numeric(u32), + + /// Win32 uses a Unicode string to represent a monitor. + Name(String), + + /// Other platforms (Android) don't support monitor identification. + Unavailable + } +} + |