Struct webgl_stdweb::WEBGL_lose_context
[−]
[src]
pub struct WEBGL_lose_context(_);
Extension
This extension exposes new functions which simulate losing and restoring the WebGL context, even on platforms where the context can never be lost. Consult the WebGL specification for documentation about the webglcontextlost and webglcontextrestored events.
When this extension is enabled:
- loseContext and restoreContext are allowed to generate INVALID_OPERATION errors even when the context is lost.
Note that this extension is not disconnected from the WebGLRenderingContext if that object loses its context as described in "The Context Lost Event" of the WebGL specification, either through use of this API or via actual circumstances such as a system failure.
Methods
impl WEBGL_lose_context
[src]
pub fn lose_context(&self)
[src]
When this function is called and the context is not lost, simulate losing the context so as to trigger the steps described in the WebGL spec for handling context lost. The context will remain in the lost state according to the WebGL specification until restoreContext() is called. If the context is already lost when this function is called, generate an INVALID_OPERATION error.
Implementations should destroy the underlying graphics context and all graphics resources when this method is called. This is the recommended mechanism for applications to programmatically halt their use of the WebGL API.
pub fn restore_context(&self)
[src]
When this function is called while the context is lost, and the conditions defined by the WebGL specification for restoring the context are met, simulate the context being restored so as to trigger the steps described in the WebGL spec for handling the context being restored. If the context is already restored when this function is called, or if the conditions in the WebGL specification for restoring the context are not satisfied, or if the context was not lost via loseContext(), generate an INVALID_OPERATION error.
Trait Implementations
impl Debug for WEBGL_lose_context
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for WEBGL_lose_context
[src]
fn clone(&self) -> WEBGL_lose_context
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl AsRef<Reference> for WEBGL_lose_context
[src]
impl ReferenceType for WEBGL_lose_context
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
impl From<WEBGL_lose_context> for Reference
[src]
fn from(value: WEBGL_lose_context) -> Self
[src]
Performs the conversion.
impl TryFrom<WEBGL_lose_context> for Reference
[src]
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: WEBGL_lose_context) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl TryFrom<Reference> for WEBGL_lose_context
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl<'_r> TryFrom<&'_r Reference> for WEBGL_lose_context
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl TryFrom<Value> for WEBGL_lose_context
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl<'_r> TryFrom<&'_r Value> for WEBGL_lose_context
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl JsSerialize for WEBGL_lose_context
[src]
impl JsSerializeOwned for WEBGL_lose_context
[src]
fn into_js_owned<'_a>(
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
[src]
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
fn memory_required_owned(&self) -> usize
[src]
impl<'_r> JsSerializeOwned for &'_r WEBGL_lose_context
[src]
fn into_js_owned<'_a>(
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
[src]
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
fn memory_required_owned(&self) -> usize
[src]
impl InstanceOf for WEBGL_lose_context
[src]
fn instance_of(reference: &Reference) -> bool
[src]
Checks whenever a given Reference if of type Self
.