struct SurfmanRenderingContext {
gleam_gl: Rc<dyn Gl>,
glow_gl: Arc<Context>,
device: RefCell<Device>,
context: RefCell<Context>,
}Expand description
A rendering context that uses the Surfman library to create and manage
the OpenGL context and surface. This struct provides the default implementation
of the RenderingContext trait, handling the creation, management, and destruction
of the rendering context and its associated resources.
The SurfmanRenderingContext struct encapsulates the necessary data and methods
to interact with the Surfman library, including creating surfaces, binding surfaces,
resizing surfaces, presenting rendered frames, and managing the OpenGL context state.
Fields§
§gleam_gl: Rc<dyn Gl>§glow_gl: Arc<Context>§device: RefCell<Device>§context: RefCell<Context>Implementations§
Source§impl SurfmanRenderingContext
impl SurfmanRenderingContext
fn new(connection: &Connection, adapter: &Adapter) -> Result<Self, Error>
fn create_surface( &self, surface_type: SurfaceType<NativeWidget>, ) -> Result<Surface, Error>
fn bind_surface(&self, surface: Surface) -> Result<(), Error>
fn create_attached_swap_chain(&self) -> Result<SwapChain<Device>, Error>
fn resize_surface(&self, size: PhysicalSize<u32>) -> Result<(), Error>
fn present_bound_surface(&self) -> Result<(), Error>
fn native_context(&self) -> NativeContext
fn framebuffer(&self) -> Option<NativeFramebuffer>
fn prepare_for_rendering(&self)
fn read_to_image(&self, source_rectangle: DeviceIntRect) -> Option<RgbaImage>
fn make_current(&self) -> Result<(), Error>
fn create_texture( &self, surface: Surface, ) -> Option<(SurfaceTexture, u32, UntypedSize2D<i32>)>
fn destroy_texture(&self, surface_texture: SurfaceTexture) -> Option<Surface>
fn connection(&self) -> Option<Connection>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SurfmanRenderingContext
impl !RefUnwindSafe for SurfmanRenderingContext
impl !Send for SurfmanRenderingContext
impl !Sync for SurfmanRenderingContext
impl Unpin for SurfmanRenderingContext
impl !UnwindSafe for SurfmanRenderingContext
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert