make_not_current on x11

This commit is contained in:
micah
2020-12-06 14:33:56 -05:00
parent d03c7720a2
commit 569aad84d9
2 changed files with 9 additions and 0 deletions

View File

@@ -26,12 +26,15 @@ fn main() {
*control_flow = ControlFlow::Exit;
}
winit::event::Event::RedrawRequested(_) => {
context.make_current();
unsafe {
gl::ClearColor(1.0, 0.0, 1.0, 1.0);
gl::Clear(gl::COLOR_BUFFER_BIT);
}
context.swap_buffers();
context.make_not_current();
}
_ => {}
}

View File

@@ -99,6 +99,12 @@ impl GlContext {
}
}
pub fn make_not_current(&self) {
unsafe {
glx::glXMakeCurrent(self.display, 0, std::ptr::null_mut());
}
}
pub fn get_proc_address(&self, symbol: &str) -> *const c_void {
get_proc_address(symbol)
}