diff options
author | Tomaka17 <pierre.krieger1708@gmail.com> | 2014-08-12 17:04:12 +0200 |
---|---|---|
committer | Tomaka17 <pierre.krieger1708@gmail.com> | 2014-08-12 17:04:12 +0200 |
commit | 32e9b5062c2646211dbe63a826e6cd2eb9b990f8 (patch) | |
tree | a04b564a6bd1144016c72cbd0e95cde12f24feda /src | |
parent | a8c056f83b00fcceb6557ce1106db1294046d0f3 (diff) | |
download | glutin-32e9b5062c2646211dbe63a826e6cd2eb9b990f8.tar.gz glutin-32e9b5062c2646211dbe63a826e6cd2eb9b990f8.zip |
Add failure if SwapBuffers returns an error
Diffstat (limited to 'src')
-rw-r--r-- | src/win32/mod.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/win32/mod.rs b/src/win32/mod.rs index da94c70..e3920a8 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -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())); + } } } } |