Struct glutin::HeadlessRendererBuilder
source · 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_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.