mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-26 22:53:15 -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.
|
||||
pub fn swap_buffers(&self) {
|
||||
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