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

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

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

Methods

impl<'a> GLAttr<'a>
[src]

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 OpenGL context major and minor versions.

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

impl<'a> GLAttr<'a>
[src]

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");
}