Merge pull request #90 from tomaka/remove-glflush

Remove call to glFlush() before swap_buffers on win32
This commit is contained in:
tomaka 2014-10-31 17:46:16 +01:00
commit a908a14adc
4 changed files with 5 additions and 6 deletions

View file

@ -59,6 +59,7 @@ fn main() {
### Win32
- You must call `glFlush` before `swap_buffers`, or else on Windows 8 nothing will be visible on the window
- Pixel formats are not implemented
- If you don't have MinGW installed, you will need to provide `libgdi32.a` and `libopengl32.a` ; you can put them in `C:\Users\you\.rust`
- If you don't have `make` in your PATH, you can pass `--no-default-features --features "window"` when compiling ([see also](http://crates.io/manifest.html#the-[features]-section))

View file

@ -57,6 +57,8 @@ impl Context {
self.gl.Color3f(0.0, 0.0, 1.0);
self.gl.Vertex2f(0.5, -0.5);
self.gl.End();
self.gl.Flush();
}
#[cfg(target_os = "android")]
@ -78,6 +80,8 @@ impl Context {
self.gl.DrawArrays(gl::TRIANGLES, 0, 3);
self.gl.DisableClientState(gl::VERTEX_ARRAY);
self.gl.DisableClientState(gl::COLOR_ARRAY);
self.gl.Flush();
}
}

View file

@ -720,9 +720,6 @@ 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();
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx
pub fn LoadLibraryW(lpFileName: LPCWSTR) -> HMODULE;

View file

@ -228,9 +228,6 @@ impl Window {
/// See the docs in the crate root file.
pub fn swap_buffers(&self) {
unsafe {
// calling glFlush is necessary on Windows 8
ffi::glFlush();
ffi::SwapBuffers(self.hdc);
}
}