pub struct Surface {
egl: EglContext,
wsi: WindowSystemInterface,
config: Config,
pub(super) presentable: bool,
raw_window_handle: RawWindowHandle,
swapchain: RwLock<Option<Swapchain>>,
srgb_kind: SrgbFrameBufferKind,
swap_buffers_with_damage: Option<unsafe extern "system" fn(display: *const c_void, surface: *const c_void, rects: *const c_int, n_rects: c_int) -> c_uint>,
}Available on non-
webgl and (non-Windows or windows_angle) and gles only.Fields§
§egl: EglContext§wsi: WindowSystemInterface§config: Config§presentable: bool§raw_window_handle: RawWindowHandle§swapchain: RwLock<Option<Swapchain>>§srgb_kind: SrgbFrameBufferKind§swap_buffers_with_damage: Option<unsafe extern "system" fn(display: *const c_void, surface: *const c_void, rects: *const c_int, n_rects: c_int) -> c_uint>Implementations§
Source§impl Surface
impl Surface
pub(super) unsafe fn present( &self, _suf_texture: Texture, context: &AdapterContext, damage_rects: &[Rect<u32>], ) -> Result<(), SurfaceError>
unsafe fn unconfigure_impl( &self, device: &Device, ) -> Option<(Surface, Option<*mut c_void>)>
pub fn supports_srgb(&self) -> bool
Trait Implementations§
Source§impl DynResource for Surface
impl DynResource for Surface
Source§impl Surface for Surface
impl Surface for Surface
type A = Api
Source§unsafe fn configure(
&self,
device: &Device,
config: &SurfaceConfiguration,
) -> Result<(), SurfaceError>
unsafe fn configure( &self, device: &Device, config: &SurfaceConfiguration, ) -> Result<(), SurfaceError>
Source§unsafe fn unconfigure(&self, device: &Device)
unsafe fn unconfigure(&self, device: &Device)
Source§unsafe fn acquire_texture(
&self,
_timeout_ms: Option<Duration>,
_fence: &Fence,
) -> Result<AcquiredSurfaceTexture<Api>, SurfaceError>
unsafe fn acquire_texture( &self, _timeout_ms: Option<Duration>, _fence: &Fence, ) -> Result<AcquiredSurfaceTexture<Api>, SurfaceError>
Return the next texture to be presented by
self, for the caller to draw on. Read moreSource§unsafe fn discard_texture(&self, _texture: Texture)
unsafe fn discard_texture(&self, _texture: Texture)
Relinquish an acquired texture without presenting it. Read more
impl Send for Surface
impl Sync for Surface
Auto Trait Implementations§
impl !Freeze for Surface
impl !RefUnwindSafe for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
impl UnwindSafe for Surface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> DynSurface for Swhere
S: Surface + DynResource,
impl<S> DynSurface for Swhere
S: Surface + DynResource,
Source§unsafe fn configure(
&self,
device: &(dyn DynDevice + 'static),
config: &SurfaceConfiguration,
) -> Result<(), SurfaceError>
unsafe fn configure( &self, device: &(dyn DynDevice + 'static), config: &SurfaceConfiguration, ) -> Result<(), SurfaceError>
Dynamic version of Surface::configure
Source§unsafe fn unconfigure(&self, device: &(dyn DynDevice + 'static))
unsafe fn unconfigure(&self, device: &(dyn DynDevice + 'static))
Dynamic version of Surface::unconfigure
Source§unsafe fn acquire_texture(
&self,
timeout: Option<Duration>,
fence: &(dyn DynFence + 'static),
) -> Result<DynAcquiredSurfaceTexture, SurfaceError>
unsafe fn acquire_texture( &self, timeout: Option<Duration>, fence: &(dyn DynFence + 'static), ) -> Result<DynAcquiredSurfaceTexture, SurfaceError>
Dynamic version of Surface::acquire_texture
Source§unsafe fn discard_texture(&self, texture: Box<dyn DynSurfaceTexture>)
unsafe fn discard_texture(&self, texture: Box<dyn DynSurfaceTexture>)
Dynamic version of Surface::discard_texture
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more