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

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

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

Methods

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

pub fn set_red_size(&self, value: u8)[src]

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

pub fn red_size(&self) -> u8[src]

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

pub fn set_green_size(&self, value: u8)[src]

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

pub fn green_size(&self) -> u8[src]

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

pub fn set_blue_size(&self, value: u8)[src]

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

pub fn blue_size(&self) -> u8[src]

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

pub fn set_alpha_size(&self, value: u8)[src]

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

pub fn alpha_size(&self) -> u8[src]

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

pub fn set_buffer_size(&self, value: u8)[src]

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

pub fn buffer_size(&self) -> u8[src]

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

pub fn set_double_buffer(&self, value: bool)[src]

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

pub fn double_buffer(&self) -> bool[src]

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

pub fn set_depth_size(&self, value: u8)[src]

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

pub fn depth_size(&self) -> u8[src]

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

pub fn set_stencil_size(&self, value: u8)[src]

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

pub fn stencil_size(&self) -> u8[src]

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

pub fn set_accum_red_size(&self, value: u8)[src]

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

pub fn accum_red_size(&self) -> u8[src]

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

pub fn set_accum_green_size(&self, value: u8)[src]

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

pub fn accum_green_size(&self) -> u8[src]

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

pub fn set_accum_blue_size(&self, value: u8)[src]

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

pub fn accum_blue_size(&self) -> u8[src]

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

pub fn set_accum_alpha_size(&self, value: u8)[src]

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

pub fn accum_alpha_size(&self) -> u8[src]

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

pub fn set_stereo(&self, value: bool)[src]

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

pub fn stereo(&self) -> bool[src]

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

pub fn set_multisample_buffers(&self, value: u8)[src]

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

pub fn multisample_buffers(&self) -> u8[src]

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

pub fn set_multisample_samples(&self, value: u8)[src]

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

pub fn multisample_samples(&self) -> u8[src]

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

pub fn set_accelerated_visual(&self, value: bool)[src]

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

pub fn accelerated_visual(&self) -> bool[src]

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

pub fn set_context_major_version(&self, value: u8)[src]

Sets the attribute: OpenGL context major version

pub fn context_major_version(&self) -> u8[src]

Gets the attribute: OpenGL context major version

pub fn set_context_minor_version(&self, value: u8)[src]

Sets the attribute: OpenGL context minor version

pub fn context_minor_version(&self) -> u8[src]

Gets the attribute: OpenGL context minor version

pub fn set_context_profile(&self, value: GLProfile)[src]

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

pub fn context_profile(&self) -> GLProfile[src]

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

pub fn set_share_with_current_context(&self, value: bool)[src]

Sets the attribute: OpenGL context sharing; defaults to false

pub fn share_with_current_context(&self) -> bool[src]

Gets the attribute: OpenGL context sharing; defaults to false

pub fn set_framebuffer_srgb_compatible(&self, value: bool)[src]

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

pub fn framebuffer_srgb_compatible(&self) -> bool[src]

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

pub fn set_context_no_error(&self, value: bool)[src]

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

pub fn context_no_error(&self) -> bool[src]

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

pub fn set_context_version(&self, major: u8, minor: u8)[src]

Sets the OpenGL context major and minor versions.

pub fn context_version(&self) -> (u8, u8)[src]

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

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

pub fn set_context_flags(&self) -> ContextFlagsBuilder[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();

pub fn context_flags(&self) -> ContextFlags[src]

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

impl<'a> !RefUnwindSafe for GLAttr<'a>

impl<'a> !Send for GLAttr<'a>

impl<'a> !Sync for GLAttr<'a>

impl<'a> Unpin for GLAttr<'a>

impl<'a> !UnwindSafe for GLAttr<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.