egl: Expose raw types for downstream integrations
This commit is contained in:
parent
20d95c80c6
commit
74162a73b6
|
@ -264,6 +264,13 @@ impl EGLContext {
|
|||
pub fn user_data(&self) -> &UserDataMap {
|
||||
&*self.user_data
|
||||
}
|
||||
|
||||
/// Get a raw handle to the underlying context.
|
||||
///
|
||||
/// The pointer will become invalid, when this struct is destroyed.
|
||||
pub fn get_context_handle(&self) -> ffi::egl::types::EGLContext {
|
||||
self.context
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for EGLContext {
|
||||
|
|
|
@ -173,7 +173,9 @@ impl EGLDevice {
|
|||
}
|
||||
|
||||
/// Returns the pointer to the raw [`EGLDevice`].
|
||||
pub fn inner(&self) -> *const c_void {
|
||||
///
|
||||
/// The pointer will become invalid, when this struct is destroyed.
|
||||
pub fn get_device_handle(&self) -> *const c_void {
|
||||
self.inner
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,6 +172,16 @@ impl EGLSurface {
|
|||
pub fn resize(&self, width: i32, height: i32, dx: i32, dy: i32) -> bool {
|
||||
self.native.resize(width, height, dx, dy)
|
||||
}
|
||||
|
||||
/// Get a raw handle to the underlying surface
|
||||
///
|
||||
/// *Note*: The surface might get dynamically recreated during swap-buffers
|
||||
/// causing the pointer to become invalid.
|
||||
///
|
||||
/// The pointer will become invalid, when this struct is destroyed.
|
||||
pub fn get_surface_handle(&self) -> ffi::egl::types::EGLSurface {
|
||||
self.surface.load(Ordering::SeqCst)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for EGLSurface {
|
||||
|
|
Loading…
Reference in New Issue