From 32e9b5062c2646211dbe63a826e6cd2eb9b990f8 Mon Sep 17 00:00:00 2001 From: Tomaka17 Date: Tue, 12 Aug 2014 17:04:12 +0200 Subject: Add failure if SwapBuffers returns an error --- src/win32/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/win32') 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())); + } } } } -- cgit v1.2.3