mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-01 06:10:07 -04:00
Add failure if SwapBuffers returns an error
This commit is contained in:
@@ -191,7 +191,10 @@ impl Window {
|
|||||||
/// See the docs if the crate root file.
|
/// See the docs if the crate root file.
|
||||||
pub fn swap_buffers(&self) {
|
pub fn swap_buffers(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
ffi::SwapBuffers(self.hdc);
|
if ffi::SwapBuffers(self.hdc) == 0 {
|
||||||
|
use std::os;
|
||||||
|
fail!("{}", os::error_string(os::errno()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user