aboutsummaryrefslogtreecommitdiffstats
path: root/src/x11/window
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-03-04 08:00:56 +0100
committertomaka <pierre.krieger1708@gmail.com>2015-03-04 08:00:56 +0100
commit15d037963340577b5886afb1ad207f53aeb98c6d (patch)
tree2035d5b289c4838e477cbea653c6e9e4b05a0afa /src/x11/window
parent41e3328ca7d271b1291996dec9e59830d917ee2c (diff)
parent689ace8b251ceb2446fc460aad3dd19a1692f3f8 (diff)
downloadglutin-15d037963340577b5886afb1ad207f53aeb98c6d.tar.gz
glutin-15d037963340577b5886afb1ad207f53aeb98c6d.zip
Merge pull request #305 from tomaka/is-current
Add is_current function
Diffstat (limited to 'src/x11/window')
-rw-r--r--src/x11/window/mod.rs4
1 files changed, 4 insertions, 0 deletions
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;