-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
302 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
#![cfg(any(target_os = "android"))] | ||
use crate::config::Config; | ||
use crate::context::Context; | ||
use crate::surface::{Surface, SurfaceTypeTrait}; | ||
use std::os::raw; | ||
|
||
use crate::platform::ContextTraitExt; | ||
use crate::{Context, ContextCurrentState}; | ||
use crate::{SupportsPBuffersTrait, SupportsSurfacelessTrait, SupportsWindowSurfacesTrait}; | ||
#[derive(Debug, Default, Clone, PartialEq, Eq)] | ||
pub struct ConfigPlatformAttributes; | ||
|
||
pub use glutin_egl_sys::EGLContext; | ||
pub trait ConfigExt { | ||
unsafe fn raw_config(&self) -> *const raw::c_void; | ||
unsafe fn raw_display(&self) -> *mut raw::c_void; | ||
} | ||
|
||
use std::os::raw; | ||
impl ConfigExt for Config { | ||
unsafe fn raw_config(&self) -> *const raw::c_void { | ||
self.config.raw_config() | ||
} | ||
|
||
unsafe fn raw_display(&self) -> *mut raw::c_void { | ||
self.config.raw_display() | ||
} | ||
} | ||
|
||
pub trait SurfaceExt { | ||
unsafe fn raw_surface(&self) -> *const raw::c_void; | ||
} | ||
|
||
impl< | ||
IC: ContextCurrentState, | ||
PBT: SupportsPBuffersTrait, | ||
WST: SupportsWindowSurfacesTrait, | ||
ST: SupportsSurfacelessTrait, | ||
> ContextTraitExt for Context<IC, PBT, WST, ST> | ||
{ | ||
type Handle = EGLContext; | ||
|
||
#[inline] | ||
unsafe fn raw_handle(&self) -> Self::Handle { | ||
self.context.raw_handle() | ||
impl<T: SurfaceTypeTrait> SurfaceExt for Surface<T> { | ||
unsafe fn raw_surface(&self) -> *const raw::c_void { | ||
self.0.raw_surface() | ||
} | ||
} | ||
|
||
pub trait ContextExt { | ||
unsafe fn raw_context(&self) -> *mut raw::c_void; | ||
} | ||
|
||
#[inline] | ||
unsafe fn get_egl_display(&self) -> Option<*const raw::c_void> { | ||
Some(self.context.get_egl_display()) | ||
impl ContextExt for Context { | ||
unsafe fn raw_context(&self) -> *mut raw::c_void { | ||
self.0.raw_context() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.