pub struct GlRenderStateInit {
pub depth: GlDepthState,
pub blend: GlBlendState,
pub cull: GlCullState,
pub color_mask: GlColorMask,
pub scissor: Option<GlScissor>,
pub viewport: GlViewport,
}Expand description
Constructor inputs for GlRenderState.
GlRenderState::context_defaults is the only way to build one today, and
it hard-codes the state a freshly created GL context happens to be in.
Every other state — a depth-tested draw, a scissored viewport, a masked
render target — has to be assembled field by field to reach
WebGl2Backend::apply_state, which means it cannot be built from outside
the crate. Naming the inputs closes that gap.
Fields§
§depth: GlDepthStateThe depth-test state.
blend: GlBlendStateThe blend state.
cull: GlCullStateThe culling and winding state.
color_mask: GlColorMaskWhich channels the fragment stage may write.
scissor: Option<GlScissor>The scissor rectangle, or None when scissoring is off.
viewport: GlViewportThe viewport rectangle.
Implementations§
Source§impl GlRenderStateInit
impl GlRenderStateInit
pub fn get_depth(&self) -> &GlDepthState
pub fn get_mut_depth(&mut self) -> &mut GlDepthState
pub fn set_depth(&mut self, val: GlDepthState) -> &mut Self
pub fn get_blend(&self) -> &GlBlendState
pub fn get_mut_blend(&mut self) -> &mut GlBlendState
pub fn set_blend(&mut self, val: GlBlendState) -> &mut Self
pub fn get_cull(&self) -> &GlCullState
pub fn get_mut_cull(&mut self) -> &mut GlCullState
pub fn set_cull(&mut self, val: GlCullState) -> &mut Self
pub fn get_color_mask(&self) -> &GlColorMask
pub fn get_mut_color_mask(&mut self) -> &mut GlColorMask
pub fn set_color_mask(&mut self, val: GlColorMask) -> &mut Self
pub fn get_scissor(&self) -> Option<GlScissor>
pub fn try_get_scissor(&self) -> Option<GlScissor>
pub fn get_mut_scissor(&mut self) -> &mut Option<GlScissor>
pub fn set_scissor(&mut self, val: Option<GlScissor>) -> &mut Self
pub fn get_viewport(&self) -> &GlViewport
pub fn get_mut_viewport(&mut self) -> &mut GlViewport
pub fn set_viewport(&mut self, val: GlViewport) -> &mut Self
Source§impl GlRenderStateInit
impl GlRenderStateInit
pub fn new( depth: GlDepthState, blend: GlBlendState, cull: GlCullState, color_mask: GlColorMask, scissor: Option<GlScissor>, viewport: GlViewport, ) -> Self
Trait Implementations§
Source§impl Clone for GlRenderStateInit
impl Clone for GlRenderStateInit
impl Copy for GlRenderStateInit
Auto Trait Implementations§
impl Freeze for GlRenderStateInit
impl RefUnwindSafe for GlRenderStateInit
impl Send for GlRenderStateInit
impl Sync for GlRenderStateInit
impl Unpin for GlRenderStateInit
impl UnsafeUnpin for GlRenderStateInit
impl UnwindSafe for GlRenderStateInit
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