From 5693fbcce3ca04aa7a26920add40ea770419f3ea Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Fri, 24 Oct 2014 15:20:25 +1000 Subject: Add accessor for underlying display handle on Linux. Although unimplemented on other platforms, this applies to at least android as well. --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 041ebeb..33c66db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -341,6 +341,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 fn platform_display(&self) -> *mut libc::c_void { + self.window.platform_display() + } } /// Represents a headless OpenGL context. -- cgit v1.2.3 From 21e3ff99fa5628011fe226dd13a87e09f0f33330 Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Fri, 24 Oct 2014 18:12:03 +1000 Subject: Make platform data function as unsafe. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 33c66db..868d4c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -346,7 +346,7 @@ impl Window { /// This is typically only required when integrating with /// other libraries that need this information. #[inline] - pub fn platform_display(&self) -> *mut libc::c_void { + pub unsafe fn platform_display(&self) -> *mut libc::c_void { self.window.platform_display() } } -- cgit v1.2.3