aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomaka17 <pierre.krieger1708@gmail.com>2014-08-03 09:25:30 +0200
committerTomaka17 <pierre.krieger1708@gmail.com>2014-08-03 09:25:30 +0200
commitf4fb699b5242d13482a3c1931e71a52c79a7e535 (patch)
treeb72dc96d6b69f4aa0c0d5c32893b435a07803b9f
parent52cccb8ddadbfff338b627d4f8c654840be1840b (diff)
downloadglutin-f4fb699b5242d13482a3c1931e71a52c79a7e535.tar.gz
glutin-f4fb699b5242d13482a3c1931e71a52c79a7e535.zip
Add dummy implementation for OS/X
-rw-r--r--.travis.yml4
-rw-r--r--src/lib.rs6
-rw-r--r--src/osx/mod.rs79
3 files changed, 87 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 22761ba..eab930b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1 +1,5 @@
language: rust
+
+os:
+ - linux
+ - osx
diff --git a/src/lib.rs b/src/lib.rs
index f38a4b8..914dedc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,10 +26,12 @@ use winimpl = win32;
#[cfg(unix)]
use winimpl = x11;
-#[cfg(windows)]
+#[cfg(target_os = "win32")]
mod win32;
-#[cfg(unix)]
+#[cfg(target_os = "linux")]
mod x11;
+#[cfg(target_os = "macos")]
+mod osx;
#[allow(dead_code)]
//mod egl;
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<MonitorID> {
+ unimplemented!()
+}
+
+pub fn get_primary_monitor() -> MonitorID {
+ unimplemented!()
+}
+
+impl MonitorID {
+ pub fn get_name(&self) -> Option<String> {
+ unimplemented!()
+ }
+
+ pub fn get_dimensions(&self) -> (uint, uint) {
+ unimplemented!()
+ }
+}
+
+impl Window {
+ pub fn new(_builder: WindowBuilder) -> Result<Window, String> {
+ 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<Event> {
+ unimplemented!()
+ }
+
+ pub fn wait_events(&self) -> Vec<Event> {
+ unimplemented!()
+ }
+
+ pub unsafe fn make_current(&self) {
+ unimplemented!()
+ }
+
+ pub fn get_proc_address(&self, _addr: &str) -> *const () {
+ unimplemented!()
+ }
+
+ pub fn swap_buffers(&self) {
+ unimplemented!()
+ }
+}