Struct nannou::ContextBuilder[]

pub struct ContextBuilder<'a> {
    pub gl_attr: GlAttributes<&'a Context>,
    // some fields omitted
}

Object that allows you to build Contexts.

Fields

The attributes to use to create the context.

Methods

impl<'a> ContextBuilder<'a>

Initializes a new ContextBuilder with default values.

Sets how the backend should choose the OpenGL API and version.

Sets the desired OpenGL context profile.

Sets the debug flag for the OpenGL context.

The default value for this flag is cfg!(debug_assertions), which means that it's enabled when you run cargo build and disabled when you run cargo build --release.

Sets the robustness of the OpenGL context. See the docs of Robustness.

Requests that the window has vsync enabled.

By default, vsync is not enabled.

Share the display lists with the given Context.

Sets the multisampling level to request. A value of 0 indicates that multisampling must not be enabled.

Panic

Will panic if samples is not a power of two.

Sets the number of bits in the depth buffer.

Sets the number of bits in the stencil buffer.

Sets the number of bits in the color buffer.

Request the backend to be stereoscopic.

Sets whether sRGB should be enabled on the window.

The default value is false.

Sets whether double buffering should be enabled.

The default value is None.

Platform-specific

This option will be taken into account on the following platforms:

  • MacOS
  • Linux using GLX with X
  • Windows using WGL

Sets whether hardware acceleration is required.

The default value is Some(true)

Platform-specific

This option will be taken into account on the following platforms:

  • MacOS
  • Linux using EGL with either X or Wayland
  • Windows using EGL or WGL
  • Android using EGL

Auto Trait Implementations

impl<'a> Send for ContextBuilder<'a>

impl<'a> Sync for ContextBuilder<'a>