mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-31 13:50:05 -04:00
Add is_current function
This commit is contained in:
@@ -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| {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user