Struct sdl2::video::gl_attr::GLAttr[][src]

pub struct GLAttr<'a> { /* fields omitted */ }
Expand description

OpenGL context getters and setters. Obtain with VideoSubsystem::gl_attr().

Implementations

Sets the attribute: the minimum number of bits for the red channel of the color buffer; defaults to 3

Gets the attribute: the minimum number of bits for the red channel of the color buffer; defaults to 3

Sets the attribute: the minimum number of bits for the green channel of the color buffer; defaults to 3

Gets the attribute: the minimum number of bits for the green channel of the color buffer; defaults to 3

Sets the attribute: the minimum number of bits for the blue channel of the color buffer; defaults to 2

Gets the attribute: the minimum number of bits for the blue channel of the color buffer; defaults to 2

Sets the attribute: the minimum number of bits for the alpha channel of the color buffer; defaults to 0

Gets the attribute: the minimum number of bits for the alpha channel of the color buffer; defaults to 0

Sets the attribute: the minimum number of bits for frame buffer size; defaults to 0

Gets the attribute: the minimum number of bits for frame buffer size; defaults to 0

Sets the attribute: whether the output is single or double buffered; defaults to double buffering on

Gets the attribute: whether the output is single or double buffered; defaults to double buffering on

Sets the attribute: the minimum number of bits in the depth buffer; defaults to 16

Gets the attribute: the minimum number of bits in the depth buffer; defaults to 16

Sets the attribute: the minimum number of bits in the stencil buffer; defaults to 0

Gets the attribute: the minimum number of bits in the stencil buffer; defaults to 0

Sets the attribute: the minimum number of bits for the red channel of the accumulation buffer; defaults to 0

Gets the attribute: the minimum number of bits for the red channel of the accumulation buffer; defaults to 0

Sets the attribute: the minimum number of bits for the green channel of the accumulation buffer; defaults to 0

Gets the attribute: the minimum number of bits for the green channel of the accumulation buffer; defaults to 0

Sets the attribute: the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0

Gets the attribute: the minimum number of bits for the blue channel of the accumulation buffer; defaults to 0

Sets the attribute: the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0

Gets the attribute: the minimum number of bits for the alpha channel of the accumulation buffer; defaults to 0

Sets the attribute: whether the output is stereo 3D; defaults to off

Gets the attribute: whether the output is stereo 3D; defaults to off

Sets the attribute: the number of buffers used for multisample anti-aliasing; defaults to 0

Gets the attribute: the number of buffers used for multisample anti-aliasing; defaults to 0

Sets the attribute: the number of samples used around the current pixel used for multisample anti-aliasing; defaults to 0

Gets the attribute: the number of samples used around the current pixel used for multisample anti-aliasing; defaults to 0

Sets the attribute: whether to require hardware acceleration; false to force software rendering; defaults to allow either

Gets the attribute: whether to require hardware acceleration; false to force software rendering; defaults to allow either

Sets the attribute: OpenGL context major version

Gets the attribute: OpenGL context major version

Sets the attribute: OpenGL context minor version

Gets the attribute: OpenGL context minor version

Sets the attribute: type of GL context (Core, Compatibility, ES)

Gets the attribute: type of GL context (Core, Compatibility, ES)

Sets the attribute: OpenGL context sharing; defaults to false

Gets the attribute: OpenGL context sharing; defaults to false

Sets the attribute: requests sRGB capable visual; defaults to false (>= SDL 2.0.1)

Gets the attribute: requests sRGB capable visual; defaults to false (>= SDL 2.0.1)

Sets the attribute: disables OpenGL error checking; defaults to false (>= SDL 2.0.6)

Gets the attribute: disables OpenGL error checking; defaults to false (>= SDL 2.0.6)

Sets the OpenGL context major and minor versions.

Gets the OpenGL context major and minor versions as a tuple.

Sets any combination of OpenGL context configuration flags.

Note that calling this will reset any existing context flags.

Example
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
let gl_attr = video_subsystem.gl_attr();

// Sets the GL context into debug mode.
gl_attr.set_context_flags().debug().set();

Gets the applied OpenGL context configuration flags.

Example
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
let gl_attr = video_subsystem.gl_attr();

// Is the GL context in debug mode?
if gl_attr.context_flags().has_debug() {
    println!("Debug mode");
}

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.