diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2016-01-07 16:01:18 +0100 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2016-02-10 17:39:35 +0100 |
commit | ec76d991adc3522512f07935f78569dc4a9d089b (patch) | |
tree | 6a16b4f7559cfb4504b7993df1a0d55632499c5e /src/api/cocoa | |
parent | 86dd75f7e9b6078919387c356bca7dd1738d5777 (diff) | |
download | glutin-ec76d991adc3522512f07935f78569dc4a9d089b.tar.gz glutin-ec76d991adc3522512f07935f78569dc4a9d089b.zip |
Unlocks platform-specific attributes
Diffstat (limited to 'src/api/cocoa')
-rw-r--r-- | src/api/cocoa/headless.rs | 7 | ||||
-rw-r--r-- | src/api/cocoa/mod.rs | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/api/cocoa/headless.rs b/src/api/cocoa/headless.rs index 7fe2046..ac6c4e0 100644 --- a/src/api/cocoa/headless.rs +++ b/src/api/cocoa/headless.rs @@ -13,6 +13,9 @@ use cocoa::appkit::*; use PixelFormat; use api::cocoa::helpers; +#[derive(Default)] +pub struct PlatformSpecificHeadlessBuilderAttributes; + pub struct HeadlessContext { width: u32, height: u32, @@ -21,7 +24,9 @@ pub struct HeadlessContext { impl HeadlessContext { pub fn new((width, height): (u32, u32), pf_reqs: &PixelFormatRequirements, - opengl: &GlAttributes<&HeadlessContext>) -> Result<HeadlessContext, CreationError> + opengl: &GlAttributes<&HeadlessContext>, + _: &PlatformSpecificHeadlessBuilderAttributes) + -> Result<HeadlessContext, CreationError> { let context = unsafe { diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs index d35182e..4502405 100644 --- a/src/api/cocoa/mod.rs +++ b/src/api/cocoa/mod.rs @@ -1,7 +1,5 @@ #![cfg(target_os = "macos")] -pub use self::headless::HeadlessContext; - use {CreationError, Event, MouseCursor, CursorState}; use CreationError::OsError; use libc; @@ -50,6 +48,8 @@ use events::MouseButton; use events; pub use self::monitor::{MonitorId, get_available_monitors, get_primary_monitor}; +pub use self::headless::HeadlessContext; +pub use self::headless::PlatformSpecificHeadlessBuilderAttributes; mod monitor; mod event; @@ -179,6 +179,9 @@ impl Drop for WindowDelegate { } } +#[derive(Default)] +pub struct PlatformSpecificWindowBuilderAttributes; + pub struct Window { view: IdRef, window: IdRef, @@ -264,7 +267,8 @@ impl<'a> Iterator for WaitEventsIterator<'a> { impl Window { pub fn new(win_attribs: &WindowAttributes, pf_reqs: &PixelFormatRequirements, - opengl: &GlAttributes<&Window>) -> Result<Window, CreationError> + opengl: &GlAttributes<&Window>, _: &PlatformSpecificWindowBuilderAttributes) + -> Result<Window, CreationError> { if opengl.sharing.is_some() { unimplemented!() |