Merge pull request #66 from glennw/platform_data

Add accessor for underlying display handle on Linux.
This commit is contained in:
tomaka 2014-10-24 10:19:35 +02:00
commit fe8646c556
5 changed files with 24 additions and 0 deletions

View file

@ -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]

View file

@ -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 unsafe fn platform_display(&self) -> *mut libc::c_void {
self.window.platform_display()
}
}
/// Represents a headless OpenGL context.

View file

@ -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!()
}
}

View file

@ -233,6 +233,10 @@ impl Window {
ffi::SwapBuffers(self.hdc);
}
}
pub fn platform_display(&self) -> *mut libc::c_void {
unimplemented!()
}
}
#[unsafe_destructor]

View file

@ -469,6 +469,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 {