Trait GlWindow

Source
pub trait GlWindow {
    // Required methods
    fn build_surface_attributes(
        &self,
        builder: SurfaceAttributesBuilder<WindowSurface>,
    ) -> Result<SurfaceAttributes<WindowSurface>, HandleError>;
    fn resize_surface(
        &self,
        surface: &Surface<impl SurfaceTypeTrait + ResizeableSurface>,
        context: &PossiblyCurrentContext,
    );
}
Expand description

Window extensions for working with glutin surfaces.

Required Methods§

Source

fn build_surface_attributes( &self, builder: SurfaceAttributesBuilder<WindowSurface>, ) -> Result<SurfaceAttributes<WindowSurface>, HandleError>

Build the surface attributes suitable to create a window surface.

§Panics

Panics if either window inner dimension is zero.

§Example
use glutin_winit::GlWindow;

let attrs = winit_window.build_surface_attributes(<_>::default());
Source

fn resize_surface( &self, surface: &Surface<impl SurfaceTypeTrait + ResizeableSurface>, context: &PossiblyCurrentContext, )

Resize the surface to the window inner size.

No-op if either window size is zero.

§Example
use glutin_winit::GlWindow;

winit_window.resize_surface(&gl_surface, &gl_context);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl GlWindow for Window

Implementors§