pub struct Surface<T: 'static> { /* private fields */ }Expand description
A gbm rendering surface
Implementations§
source§impl<T: 'static> Surface<T>
impl<T: 'static> Surface<T>
sourcepub fn has_free_buffers(&self) -> bool
pub fn has_free_buffers(&self) -> bool
Return whether or not a surface has free (non-locked) buffers
Before starting a new frame, the surface must have a buffer available for rendering. Initially, a gbm surface will have a free buffer, but after one or more buffers have been locked, the application must check for a free buffer before rendering.
sourcepub unsafe fn lock_front_buffer(
&self
) -> Result<SurfaceBufferHandle<T>, FrontBufferError>
pub unsafe fn lock_front_buffer(
&self
) -> Result<SurfaceBufferHandle<T>, FrontBufferError>
Lock the surface’s current front buffer
Locks rendering to the surface’s current front buffer and returns
a handle to the underlying BufferObject
If an error occurs a FrontBufferError is returned.
Unsafety: This function must be called exactly once after calling
eglSwapBuffers. Calling it before any eglSwapBuffer has happened
on the surface or two or more times after eglSwapBuffers is an
error and may cause undefined behavior.