pub struct HeadlessContext { /* private fields */ }headless and non-WebAssembly only.Expand description
A headless graphics context, ie. a graphics context that is not associated with any window. For a graphics context associated with a window, see WindowedContext. Can only be created on native, not on web.
Implementations§
Source§impl HeadlessContext
impl HeadlessContext
Sourcepub fn new() -> Result<Self, HeadlessError>
pub fn new() -> Result<Self, HeadlessError>
Creates a new headless graphics context.
Methods from Deref<Target = Context>§
Sourcepub fn set_scissor(&self, scissor_box: ScissorBox)
pub fn set_scissor(&self, scissor_box: ScissorBox)
Set the scissor test for this context (see ScissorBox).
Sourcepub fn set_viewport(&self, viewport: Viewport)
pub fn set_viewport(&self, viewport: Viewport)
Set the viewport for this context (See Viewport).
Sourcepub fn set_write_mask(&self, write_mask: WriteMask)
pub fn set_write_mask(&self, write_mask: WriteMask)
Set the write mask for this context (see WriteMask).
Sourcepub fn set_depth_test(&self, depth_test: DepthTest)
pub fn set_depth_test(&self, depth_test: DepthTest)
Set the depth test for this context (see DepthTest).
Sourcepub fn set_render_states(&self, render_states: RenderStates)
pub fn set_render_states(&self, render_states: RenderStates)
Set the render states for this context (see RenderStates).
Sourcepub fn error_check(&self) -> Result<(), CoreError>
pub fn error_check(&self) -> Result<(), CoreError>
Returns an error if an GPU-side error has happened while rendering which can be used to check for errors while developing. Can also be used in production to handle unexpected rendering errors, but do not call it too often to avoid performance problems.
Trait Implementations§
Source§impl Clone for HeadlessContext
impl Clone for HeadlessContext
Source§fn clone(&self) -> HeadlessContext
fn clone(&self) -> HeadlessContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more