aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Partouche <DavidPartouche@users.noreply.github.com>2014-11-25 23:55:09 +0100
committerDavid Partouche <DavidPartouche@users.noreply.github.com>2014-11-25 23:55:09 +0100
commitef33f198128c8033d23261e9e7466840b66b89ce (patch)
treeb0db014cd3daa5f836deaa17fb303f040e9c3b88 /src
parentd7a7765638d4638c48e4b76477b32da6be7957b3 (diff)
parentd99ba30216c72390593476f1b58fb9852f7091a1 (diff)
downloadglutin-ef33f198128c8033d23261e9e7466840b66b89ce.tar.gz
glutin-ef33f198128c8033d23261e9e7466840b66b89ce.zip
Merge pull request #137 from glennw/android-headless-compile
Allows android to compile when headless feature is enabled.
Diffstat (limited to 'src')
-rw-r--r--src/android/mod.rs30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/android/mod.rs b/src/android/mod.rs
index 2f6ffb1..27fc8e0 100644
--- a/src/android/mod.rs
+++ b/src/android/mod.rs
@@ -7,6 +7,9 @@ use events::ElementState::{Pressed, Released};
use events::Event::{MouseInput, MouseMoved};
use events::MouseButton::LeftMouseButton;
+#[cfg(feature = "headless")]
+use HeadlessRendererBuilder;
+
pub struct Window {
display: ffi::egl::types::EGLDisplay,
context: ffi::egl::types::EGLContext,
@@ -38,6 +41,27 @@ impl MonitorID {
}
}
+#[cfg(feature = "headless")]
+pub struct HeadlessContext(int);
+
+#[cfg(feature = "headless")]
+impl HeadlessContext {
+ /// See the docs in the crate root file.
+ pub fn new(builder: HeadlessRendererBuilder) -> Result<HeadlessContext, CreationError> {
+ unimplemented!()
+ }
+
+ /// See the docs in the crate root file.
+ pub unsafe fn make_current(&self) {
+ unimplemented!()
+ }
+
+ /// See the docs in the crate root file.
+ pub fn get_proc_address(&self, addr: &str) -> *const () {
+ unimplemented!()
+ }
+}
+
impl Window {
pub fn new(builder: WindowBuilder) -> Result<Window, CreationError> {
use std::{mem, ptr};
@@ -116,7 +140,7 @@ impl Window {
}
surface
};
-
+
android_glue::write_log("eglCreateWindowSurface succeeded");
let (tx, rx) = channel();
@@ -196,8 +220,8 @@ impl Window {
},
},
Err(_) => {
- break;
- },
+ break;
+ },
}
}
events