From f4fb699b5242d13482a3c1931e71a52c79a7e535 Mon Sep 17 00:00:00 2001 From: Tomaka17 Date: Sun, 3 Aug 2014 09:25:30 +0200 Subject: Add dummy implementation for OS/X --- src/osx/mod.rs | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/osx/mod.rs (limited to 'src/osx/mod.rs') diff --git a/src/osx/mod.rs b/src/osx/mod.rs new file mode 100644 index 0000000..dcf714b --- /dev/null +++ b/src/osx/mod.rs @@ -0,0 +1,79 @@ +//! Dummy implementation for OS/X to make gl-init-rs compile on this platform + +use WindowBuilder; + +pub struct Window; + +pub struct MonitorID; + +pub fn get_available_monitors() -> Vec { + unimplemented!() +} + +pub fn get_primary_monitor() -> MonitorID { + unimplemented!() +} + +impl MonitorID { + pub fn get_name(&self) -> Option { + unimplemented!() + } + + pub fn get_dimensions(&self) -> (uint, uint) { + unimplemented!() + } +} + +impl Window { + pub fn new(_builder: WindowBuilder) -> Result { + unimplemented!() + } + + pub fn is_closed(&self) -> bool { + unimplemented!() + } + + pub fn set_title(&self, _title: &str) { + unimplemented!() + } + + pub fn get_position(&self) -> Option<(int, int)> { + unimplemented!() + } + + pub fn set_position(&self, _x: uint, _y: uint) { + unimplemented!() + } + + pub fn get_inner_size(&self) -> Option<(uint, uint)> { + unimplemented!() + } + + pub fn get_outer_size(&self) -> Option<(uint, uint)> { + unimplemented!() + } + + pub fn set_inner_size(&self, _x: uint, _y: uint) { + unimplemented!() + } + + pub fn poll_events(&self) -> Vec { + unimplemented!() + } + + pub fn wait_events(&self) -> Vec { + unimplemented!() + } + + pub unsafe fn make_current(&self) { + unimplemented!() + } + + pub fn get_proc_address(&self, _addr: &str) -> *const () { + unimplemented!() + } + + pub fn swap_buffers(&self) { + unimplemented!() + } +} -- cgit v1.2.3 From f1993be9eae49ad9a1d5e8e8d2b3749ad4379a70 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Sun, 3 Aug 2014 18:30:31 +0200 Subject: Fix bugs from f4fb699b524 --- src/lib.rs | 4 +++- src/osx/mod.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/osx/mod.rs') diff --git a/src/lib.rs b/src/lib.rs index ee79fd9..60ce0aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,8 +23,10 @@ pub use events::*; #[cfg(windows)] use winimpl = win32; -#[cfg(unix)] +#[cfg(target_os = "linux")] use winimpl = x11; +#[cfg(target_os = "macos")] +use winimpl = osx; #[cfg(target_os = "win32")] mod win32; diff --git a/src/osx/mod.rs b/src/osx/mod.rs index dcf714b..f846cf4 100644 --- a/src/osx/mod.rs +++ b/src/osx/mod.rs @@ -1,6 +1,6 @@ //! Dummy implementation for OS/X to make gl-init-rs compile on this platform -use WindowBuilder; +use {Event, WindowBuilder}; pub struct Window; -- cgit v1.2.3