WebGLRenderingContext

Struct WebGLRenderingContext 

Source
pub struct WebGLRenderingContext { /* private fields */ }
Expand description

The WebGLRenderingContext class. WebGLRenderingContext

Implementations§

Source§

impl WebGLRenderingContext

Source§

impl WebGLRenderingContext

Source

pub fn buffer_data(&self, target: &Any, size: &Any, usage: &Any) -> Undefined

The bufferData method. WebGLRenderingContext.bufferData

Source§

impl WebGLRenderingContext

Source

pub fn buffer_data_with_target_and_data_and_usage( &self, target: &Any, data: &Any, usage: &Any, ) -> Undefined

The bufferData method. WebGLRenderingContext.bufferData

Source§

impl WebGLRenderingContext

Source

pub fn buffer_sub_data( &self, target: &Any, offset: &Any, data: &Any, ) -> Undefined

The bufferSubData method. WebGLRenderingContext.bufferSubData

Source§

impl WebGLRenderingContext

Source

pub fn compressed_tex_image2_d( &self, target: &Any, level: &Any, internalformat: &Any, width: &Any, height: &Any, border: &Any, data: &Any, ) -> Undefined

The compressedTexImage2D method. WebGLRenderingContext.compressedTexImage2D

Source§

impl WebGLRenderingContext

Source

pub fn compressed_tex_sub_image2_d( &self, target: &Any, level: &Any, xoffset: &Any, yoffset: &Any, width: &Any, height: &Any, format: &Any, data: &Any, ) -> Undefined

The compressedTexSubImage2D method. WebGLRenderingContext.compressedTexSubImage2D

Source§

impl WebGLRenderingContext

Source

pub fn read_pixels( &self, x: &Any, y: &Any, width: &Any, height: &Any, format: &Any, type_: &Any, pixels: &Any, ) -> Undefined

The readPixels method. WebGLRenderingContext.readPixels

Source§

impl WebGLRenderingContext

Source

pub fn tex_image2_d( &self, target: &Any, level: &Any, internalformat: &Any, width: &Any, height: &Any, border: &Any, format: &Any, type_: &Any, pixels: &Any, ) -> Undefined

The texImage2D method. WebGLRenderingContext.texImage2D

Source§

impl WebGLRenderingContext

Source

pub fn tex_image2_d_with_target_and_level_and_internalformat_and_format_and_type_and_source( &self, target: &Any, level: &Any, internalformat: &Any, format: &Any, type_: &Any, source: &Any, ) -> Undefined

The texImage2D method. WebGLRenderingContext.texImage2D

Source§

impl WebGLRenderingContext

Source

pub fn tex_sub_image2_d( &self, target: &Any, level: &Any, xoffset: &Any, yoffset: &Any, width: &Any, height: &Any, format: &Any, type_: &Any, pixels: &Any, ) -> Undefined

The texSubImage2D method. WebGLRenderingContext.texSubImage2D

Source§

impl WebGLRenderingContext

Source

pub fn tex_sub_image2_d_with_target_and_level_and_xoffset_and_yoffset_and_format_and_type_and_source( &self, target: &Any, level: &Any, xoffset: &Any, yoffset: &Any, format: &Any, type_: &Any, source: &Any, ) -> Undefined

The texSubImage2D method. WebGLRenderingContext.texSubImage2D

Source§

impl WebGLRenderingContext

Source

pub fn uniform1fv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform1fv method. WebGLRenderingContext.uniform1fv

Source§

impl WebGLRenderingContext

Source

pub fn uniform2fv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform2fv method. WebGLRenderingContext.uniform2fv

Source§

impl WebGLRenderingContext

Source

pub fn uniform3fv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform3fv method. WebGLRenderingContext.uniform3fv

Source§

impl WebGLRenderingContext

Source

pub fn uniform4fv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform4fv method. WebGLRenderingContext.uniform4fv

Source§

impl WebGLRenderingContext

Source

pub fn uniform1iv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform1iv method. WebGLRenderingContext.uniform1iv

Source§

impl WebGLRenderingContext

Source

pub fn uniform2iv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform2iv method. WebGLRenderingContext.uniform2iv

Source§

impl WebGLRenderingContext

Source

pub fn uniform3iv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform3iv method. WebGLRenderingContext.uniform3iv

Source§

impl WebGLRenderingContext

Source

pub fn uniform4iv(&self, location: &WebGLUniformLocation, v: &Any) -> Undefined

The uniform4iv method. WebGLRenderingContext.uniform4iv

Source§

impl WebGLRenderingContext

Source

pub fn uniform_matrix2fv( &self, location: &WebGLUniformLocation, transpose: &Any, value: &Any, ) -> Undefined

The uniformMatrix2fv method. WebGLRenderingContext.uniformMatrix2fv

Source§

impl WebGLRenderingContext

Source

pub fn uniform_matrix3fv( &self, location: &WebGLUniformLocation, transpose: &Any, value: &Any, ) -> Undefined

The uniformMatrix3fv method. WebGLRenderingContext.uniformMatrix3fv

Source§

impl WebGLRenderingContext

Source

pub fn uniform_matrix4fv( &self, location: &WebGLUniformLocation, transpose: &Any, value: &Any, ) -> Undefined

The uniformMatrix4fv method. WebGLRenderingContext.uniformMatrix4fv

Methods from Deref<Target = Any>§

Source

pub fn get<T>(&self, prop: T) -> Val
where T: Into<Val>,

Gets the property prop

Source

pub fn set<K, V>(&self, prop: K, val: V)
where K: Into<Val>, V: Into<Val>,

Set the underlying js object property prop to val

Source

pub fn has<T>(&self, prop: T) -> bool
where T: Into<Val>,

Checks whether a property prop exists

Source

pub fn has_own_property(&self, prop: &str) -> bool

Checks whether a non-inherited property prop exists

Source

pub fn type_of(&self) -> String

Gets the typeof the underlying js object

Source

pub fn at<T>(&self, idx: T) -> Val
where T: Into<Val>,

Gets the element at index idx. Assumes the underlying js type is indexable

Source

pub fn to_vec<V>(&self) -> Vec<V>
where V: FromVal,

Converts the underlying js array to a Vec of V

Source

pub fn call(&self, f: &str, args: &[Val]) -> Val

Calls the method f with args, can return an undefined js value

Source

pub fn new(&self, args: &[Val]) -> Val

Calls the object’s constructor with args constructing a new object

Source

pub fn invoke(&self, args: &[Val]) -> Val

Invokes the function object with args, can return an undefined js value

Source

pub fn await_(&self) -> Val

Awaits the invoked function object

Source

pub fn instanceof(&self, v: Val) -> bool

Checks whether this Val is an instanceof v

Source

pub fn is_number(&self) -> bool

Source

pub fn is_bool(&self) -> bool

Source

pub fn is_string(&self) -> bool

Source

pub fn is_null(&self) -> bool

Source

pub fn is_undefined(&self) -> bool

Source

pub fn is_error(&self) -> bool

Source

pub fn is_function(&self) -> bool

Source

pub fn as_<T>(&self) -> T
where T: FromVal,

Source

pub fn to_utf16(&self) -> Option<Vec<u16>>

Extracts UTF-16 data as Option<Vec>

Source

pub fn to_utf16_result(&self) -> Result<Vec<u16>, Val>

Extracts UTF-16 data, returning error if null or if self is error

Trait Implementations§

Source§

impl AsMut<Val> for WebGLRenderingContext

Source§

fn as_mut(&mut self) -> &mut Any

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<Val> for WebGLRenderingContext

Source§

fn as_ref(&self) -> &Any

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for WebGLRenderingContext

Source§

fn clone(&self) -> WebGLRenderingContext

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WebGLRenderingContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for WebGLRenderingContext

Source§

type Target = Val

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for WebGLRenderingContext

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl DynCast for WebGLRenderingContext

Source§

fn instanceof(val: &Any) -> bool

Implementation of val instanceof ThisType.
Source§

fn unchecked_from_val(v: Any) -> Self

Zero-cost unchecked conversion from Val into Self.
Source§

fn unchecked_from_val_ref(v: &Any) -> &Self

Zero-cost unchecked conversion from &Val into &Self.
Source§

fn unchecked_from_val_mut(v: &mut Any) -> &mut Self

Zero-cost unchecked conversion from &mut Val into &mut Self.
Source§

fn has_type<T>(&self) -> bool
where T: DynCast,

Source§

fn dyn_into<T>(self) -> Result<T, Self>
where T: DynCast,

Source§

fn dyn_ref<T>(&self) -> Option<&T>
where T: DynCast,

Source§

fn dyn_mut<T>(&mut self) -> Option<&mut T>
where T: DynCast,

Source§

fn unchecked_into<T>(self) -> T
where T: DynCast,

Source§

fn unchecked_ref<T>(&self) -> &T
where T: DynCast,

Source§

fn unchecked_mut<T>(&mut self) -> &mut T
where T: DynCast,

Source§

fn is_instance_of<T>(&self) -> bool
where T: DynCast,

Source§

fn is_type_of(val: &Val) -> bool

Customisable brand check – defaults to instanceof.
Source§

impl From<&WebGLRenderingContext> for Any

Source§

fn from(s: &WebGLRenderingContext) -> Any

Converts to this type from the input type.
Source§

impl From<WebGLRenderingContext> for Any

Source§

fn from(s: WebGLRenderingContext) -> Any

Converts to this type from the input type.
Source§

impl FromVal for WebGLRenderingContext

Source§

fn from_val(v: &Any) -> Self

Creates a Val object from another
Source§

fn take_ownership(v: AnyHandle) -> Self

Takes the ownership of a handle
Source§

fn as_handle(&self) -> AnyHandle

Returns the raw js handle
Source§

impl PartialEq for WebGLRenderingContext

Source§

fn eq(&self, other: &WebGLRenderingContext) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for WebGLRenderingContext

Source§

fn partial_cmp(&self, other: &WebGLRenderingContext) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for WebGLRenderingContext

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.