pub struct HeadlessRendererBuilder<'a> {
pub dimensions: (u32, u32),
pub opengl: GlAttributes<&'a HeadlessContext>,
/* private fields */
}
Expand description
Object that allows you to build headless contexts.
Fields§
§dimensions: (u32, u32)
The dimensions to use.
opengl: GlAttributes<&'a HeadlessContext>
The OpenGL attributes to build the context with.
Implementations§
Source§impl<'a> HeadlessRendererBuilder<'a>
impl<'a> HeadlessRendererBuilder<'a>
Sourcepub fn new(width: u32, height: u32) -> HeadlessRendererBuilder<'a>
pub fn new(width: u32, height: u32) -> HeadlessRendererBuilder<'a>
Initializes a new HeadlessRendererBuilder
with default values.
Sourcepub fn with_gl(self, request: GlRequest) -> HeadlessRendererBuilder<'a>
pub fn with_gl(self, request: GlRequest) -> HeadlessRendererBuilder<'a>
Sets how the backend should choose the OpenGL API and version.
Sourcepub fn with_gl_profile(self, profile: GlProfile) -> HeadlessRendererBuilder<'a>
pub fn with_gl_profile(self, profile: GlProfile) -> HeadlessRendererBuilder<'a>
Sets the desired OpenGL context profile.
Sourcepub fn with_gl_debug_flag(self, flag: bool) -> HeadlessRendererBuilder<'a>
pub fn with_gl_debug_flag(self, flag: bool) -> HeadlessRendererBuilder<'a>
Sets the debug flag for the OpenGL context.
The default value for this flag is cfg!(ndebug)
, which means that it’s enabled
when you run cargo build
and disabled when you run cargo build --release
.
Sourcepub fn with_gl_robustness(
self,
robustness: Robustness,
) -> HeadlessRendererBuilder<'a>
pub fn with_gl_robustness( self, robustness: Robustness, ) -> HeadlessRendererBuilder<'a>
Sets the robustness of the OpenGL context. See the docs of Robustness
.
Sourcepub fn build(self) -> Result<HeadlessContext, CreationError>
pub fn build(self) -> Result<HeadlessContext, CreationError>
Builds the headless context.
Error should be very rare and only occur in case of permission denied, incompatible system, out of memory, etc.
Sourcepub fn build_strict(self) -> Result<HeadlessContext, CreationError>
pub fn build_strict(self) -> Result<HeadlessContext, CreationError>
Builds the headless context.
The context is build in a strict way. That means that if the backend couldn’t give
you what you requested, an Err
will be returned.
Trait Implementations§
Source§impl<'a> Clone for HeadlessRendererBuilder<'a>
impl<'a> Clone for HeadlessRendererBuilder<'a>
Source§fn clone(&self) -> HeadlessRendererBuilder<'a>
fn clone(&self) -> HeadlessRendererBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for HeadlessRendererBuilder<'a>
impl<'a> RefUnwindSafe for HeadlessRendererBuilder<'a>
impl<'a> Send for HeadlessRendererBuilder<'a>
impl<'a> Sync for HeadlessRendererBuilder<'a>
impl<'a> Unpin for HeadlessRendererBuilder<'a>
impl<'a> UnwindSafe for HeadlessRendererBuilder<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.