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/x11/window/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/x11/window') diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index 8664b4a..404324a 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -701,6 +701,10 @@ impl Window { } } + pub fn is_current(&self) -> bool { + unsafe { ffi::glx::GetCurrentContext() == self.x.context } + } + pub fn get_proc_address(&self, addr: &str) -> *const () { use std::mem; -- cgit v1.2.3