Add failure if SwapBuffers returns an error

This commit is contained in:
Tomaka17 2014-08-12 17:04:12 +02:00
parent a8c056f83b
commit 32e9b5062c

View file

@ -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()));
}
}
}
}