pub struct SurfaceAttributesBuilder<T: SurfaceTypeTrait + Default> { /* private fields */ }
Expand description

Builder to get the required set of attributes initialized before hand.

Implementations§

source§

impl<T: SurfaceTypeTrait + Default> SurfaceAttributesBuilder<T>

source

pub fn new() -> Self

Get new surface attributes.

source

pub fn with_srgb(self, srgb: Option<bool>) -> Self

Specify whether the surface should support srgb or not. Passing None means you don’t care.

§Api-specific.

This only controls EGL surfaces, other platforms use the context for that.

source§

impl SurfaceAttributesBuilder<WindowSurface>

source

pub fn with_single_buffer(self, single_buffer: bool) -> Self

Specify whether the single buffer should be used instead of double buffering. This doesn’t guarantee that the resulted buffer will have only single buffer, to know that the single buffer is actually used query the created surface with Surface::is_single_buffered.

The surface is requested as double buffered by default.

§Api-specific.

This is EGL specific, other platforms use the context for that.

source

pub fn build( self, raw_window_handle: RawWindowHandle, width: NonZeroU32, height: NonZeroU32 ) -> SurfaceAttributes<WindowSurface>

Build the surface attributes suitable to create a window surface.

source§

impl SurfaceAttributesBuilder<PbufferSurface>

source

pub fn with_largest_pbuffer(self, largest_pbuffer: bool) -> Self

Request the largest pbuffer.

source

pub fn with_single_buffer(self, single_buffer: bool) -> Self

source

pub fn build( self, width: NonZeroU32, height: NonZeroU32 ) -> SurfaceAttributes<PbufferSurface>

Build the surface attributes suitable to create a pbuffer surface.

source§

impl SurfaceAttributesBuilder<PixmapSurface>

source

pub fn build( self, native_pixmap: NativePixmap ) -> SurfaceAttributes<PixmapSurface>

Build the surface attributes suitable to create a pixmap surface.

Trait Implementations§

source§

impl<T: Clone + SurfaceTypeTrait + Default> Clone for SurfaceAttributesBuilder<T>

source§

fn clone(&self) -> SurfaceAttributesBuilder<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + SurfaceTypeTrait + Default> Debug for SurfaceAttributesBuilder<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default + SurfaceTypeTrait + Default> Default for SurfaceAttributesBuilder<T>

source§

fn default() -> SurfaceAttributesBuilder<T>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,