make_not_current on x11
This commit is contained in:
@@ -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();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user