diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-03-04 07:38:55 +0100 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-03-04 07:43:55 +0100 |
commit | 689ace8b251ceb2446fc460aad3dd19a1692f3f8 (patch) | |
tree | 2035d5b289c4838e477cbea653c6e9e4b05a0afa /src/x11 | |
parent | 41e3328ca7d271b1291996dec9e59830d917ee2c (diff) | |
download | glutin-689ace8b251ceb2446fc460aad3dd19a1692f3f8.tar.gz glutin-689ace8b251ceb2446fc460aad3dd19a1692f3f8.zip |
Add is_current function
Diffstat (limited to 'src/x11')
-rw-r--r-- | src/x11/headless.rs | 4 | ||||
-rw-r--r-- | src/x11/window/mod.rs | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/x11/headless.rs b/src/x11/headless.rs index ca47414..e23dfa7 100644 --- a/src/x11/headless.rs +++ b/src/x11/headless.rs @@ -47,6 +47,10 @@ impl HeadlessContext { } } + pub fn is_current(&self) -> bool { + unsafe { ffi::OSMesaGetCurrentContext() == self.context } + } + pub fn get_proc_address(&self, addr: &str) -> *const () { unsafe { with_c_str(addr, |s| { 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; |