mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 15:13:13 -04:00
Merge pull request #66 from glennw/platform_data
Add accessor for underlying display handle on Linux.
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,6 +233,10 @@ impl Window {
|
||||
ffi::SwapBuffers(self.hdc);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn platform_display(&self) -> *mut libc::c_void {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
#[unsafe_destructor]
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user