diff options
-rw-r--r-- | src/android/mod.rs | 4 | ||||
-rw-r--r-- | src/lib.rs | 8 | ||||
-rw-r--r-- | src/osx/mod.rs | 4 | ||||
-rw-r--r-- | src/win32/mod.rs | 4 | ||||
-rw-r--r-- | src/x11/window/mod.rs | 4 | ||||
-rw-r--r-- | src/x11/window/monitor.rs | 1 |
6 files changed, 25 insertions, 0 deletions
diff --git a/src/android/mod.rs b/src/android/mod.rs index d900abe..ef2e5e0 100644 --- a/src/android/mod.rs +++ b/src/android/mod.rs @@ -186,6 +186,10 @@ impl Window { ffi::egl::SwapBuffers(self.display, self.surface); } } + + pub fn platform_display(&self) -> *mut libc::c_void { + unimplemented!() + } } #[unsafe_destructor] @@ -343,6 +343,14 @@ impl Window { pub fn swap_buffers(&self) { self.window.swap_buffers() } + + /// Gets the native platform specific display for this window. + /// This is typically only required when integrating with + /// other libraries that need this information. + #[inline] + pub unsafe fn platform_display(&self) -> *mut libc::c_void { + self.window.platform_display() + } } /// Represents a headless OpenGL context. diff --git a/src/osx/mod.rs b/src/osx/mod.rs index dfd2eb8..2ad1ba3 100644 --- a/src/osx/mod.rs +++ b/src/osx/mod.rs @@ -337,4 +337,8 @@ impl Window { pub fn swap_buffers(&self) { unsafe { self.context.flushBuffer(); } } + + pub fn platform_display(&self) -> *mut libc::c_void { + unimplemented!() + } } diff --git a/src/win32/mod.rs b/src/win32/mod.rs index c3da891..5ce9677 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -233,6 +233,10 @@ impl Window { ffi::SwapBuffers(self.hdc); } } + + pub fn platform_display(&self) -> *mut libc::c_void { + unimplemented!() + } } #[unsafe_destructor] diff --git a/src/x11/window/mod.rs b/src/x11/window/mod.rs index 9d29c07..99cbf9d 100644 --- a/src/x11/window/mod.rs +++ b/src/x11/window/mod.rs @@ -481,6 +481,10 @@ impl Window { pub fn swap_buffers(&self) { unsafe { ffi::glx::SwapBuffers(self.display, self.window) } } + + pub fn platform_display(&self) -> *mut libc::c_void { + self.display as *mut libc::c_void + } } impl Drop for Window { diff --git a/src/x11/window/monitor.rs b/src/x11/window/monitor.rs index a9e77d7..013b48b 100644 --- a/src/x11/window/monitor.rs +++ b/src/x11/window/monitor.rs @@ -49,6 +49,7 @@ impl MonitorID { let screen = ffi::XScreenOfDisplay(display, screen_num as i32); let width = ffi::XWidthOfScreen(screen); let height = ffi::XHeightOfScreen(screen); + ffi::XCloseDisplay(display); (width as uint, height as uint) }; |