pub struct GlState { /* private fields */ }Expand description
Manages simple GL state to reduce redundant state changes
Implementations§
Source§impl GlState
impl GlState
Sourcepub fn viewport(
&mut self,
gl: &Context,
x: i32,
y: i32,
width: i32,
height: i32,
) -> &mut Self
pub fn viewport( &mut self, gl: &Context, x: i32, y: i32, width: i32, height: i32, ) -> &mut Self
Set viewport dimensions
Sourcepub fn clear_color(
&mut self,
gl: &Context,
r: f32,
g: f32,
b: f32,
a: f32,
) -> &mut Self
pub fn clear_color( &mut self, gl: &Context, r: f32, g: f32, b: f32, a: f32, ) -> &mut Self
Set clear color
Sourcepub fn active_texture(&mut self, gl: &Context, texture_unit: u32) -> &mut Self
pub fn active_texture(&mut self, gl: &Context, texture_unit: u32) -> &mut Self
Set active texture unit
Sourcepub fn vertex_attrib_array(
&mut self,
gl: &Context,
index: u32,
enable: bool,
) -> &mut Self
pub fn vertex_attrib_array( &mut self, gl: &Context, index: u32, enable: bool, ) -> &mut Self
Enable or disable a vertex attribute array
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GlState
impl RefUnwindSafe for GlState
impl Send for GlState
impl Sync for GlState
impl Unpin for GlState
impl UnsafeUnpin for GlState
impl UnwindSafe for GlState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more