From 689ace8b251ceb2446fc460aad3dd19a1692f3f8 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 4 Mar 2015 07:38:55 +0100 Subject: Add is_current function --- src/android/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/android') diff --git a/src/android/mod.rs b/src/android/mod.rs index 84d71c2..3c01b4c 100644 --- a/src/android/mod.rs +++ b/src/android/mod.rs @@ -61,6 +61,11 @@ impl HeadlessContext { unimplemented!() } + /// See the docs in the crate root file. + pub fn is_current(&self) -> bool { + unimplemented!() + } + /// See the docs in the crate root file. pub fn get_proc_address(&self, _addr: &str) -> *const () { unimplemented!() @@ -312,6 +317,10 @@ impl Window { } } + pub fn is_current(&self) -> bool { + unsafe { ffi::egl::GetCurrentContext() == self.context } + } + pub fn get_proc_address(&self, addr: &str) -> *const () { let addr = CString::from_slice(addr.as_bytes()); let addr = addr.as_ptr(); -- cgit v1.2.3