Thanks to @Anthiste
This commit is contained in:
Tomaka17 2014-08-12 21:21:06 +02:00
parent 32e9b5062c
commit cd3fc3075a
2 changed files with 5 additions and 0 deletions

View file

@ -718,6 +718,9 @@ extern "system" {
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms633519(v=vs.85).aspx
pub fn GetWindowRect(hWnd: HWND, lpRect: *mut RECT) -> BOOL;
//
pub fn glFlush();
//
pub fn glViewport(x: libc::c_int, y: libc::c_int, w: libc::c_int, h: libc::c_int);

View file

@ -191,6 +191,8 @@ impl Window {
/// See the docs if the crate root file.
pub fn swap_buffers(&self) {
unsafe {
ffi::glFlush();
if ffi::SwapBuffers(self.hdc) == 0 {
use std::os;
fail!("{}", os::error_string(os::errno()));