Struct RendererJs

Source
pub struct RendererJs(/* private fields */);

Implementations§

Source§

impl RendererJs

Source

pub fn initialize_recorder(&mut self)

Source

pub fn start_animating(&self)

Source

pub fn stop_animating(&self)

Source

pub fn set_animation_callback( &mut self, animation_callback: Option<AnimationCallbackJs>, )

Source

pub fn start_recording(&mut self)

Source

pub fn stop_recording(&self)

Source

pub fn clear_recorded_data(&self)

Source

pub fn recorder_initialized(&self) -> bool

Source

pub fn is_animating(&self) -> bool

Source

pub fn is_recording(&self) -> bool

Source

pub fn renderer_data(&self) -> RendererDataJs

Source

pub fn builder() -> RendererDataBuilderJs

Source

pub fn canvas(&self) -> HtmlCanvasElement

Source

pub fn gl(&self) -> WebGl2RenderingContext

Source

pub fn fragment_shader(&self, fragment_shader_id: String) -> Option<WebGlShader>

Source

pub fn vertex_shader(&self, vertex_shader_id: String) -> Option<WebGlShader>

Source

pub fn program(&self, program_id: String) -> Option<WebGlProgram>

Source

pub fn uniform(&self, uniform_id: String) -> Option<UniformJs>

Source

pub fn buffer(&self, buffer_id: String) -> Option<BufferJs>

Source

pub fn attribute(&self, attribute_id: String) -> Option<AttributeJs>

Source

pub fn texture(&self, texture_id: String) -> Option<TextureJs>

Source

pub fn framebuffer(&self, framebuffer_id: String) -> Option<FramebufferJs>

Source

pub fn transform_feedback( &self, transform_feedback_id: String, ) -> Option<WebGlTransformFeedback>

Source

pub fn vao(&self, vao_id: String) -> Option<WebGlVertexArrayObject>

Source

pub fn user_ctx(&self) -> Option<Object>

Source

pub fn use_program(&self, program_id: String)

Source

pub fn use_vao(&self, vao_id: String)

Source

pub fn update_uniform(&self, uniform_id: String)

Source

pub fn update_uniforms(&self)

Source

pub fn render(&self)

Source

pub fn save_image(&self)

Source

pub fn render_callback(&self) -> Option<RenderCallbackJs>

Methods from Deref<Target = RendererJsInner>§

Source

pub fn initialize_recorder(&mut self)

Must be called before starting to record.

This prevents unexpected initialization of a MediaRecorder, when the user wasn’t expecting to need one from the handle.

Source

pub fn start_animating(&self)

Source

pub fn stop_animating(&self)

Source

pub fn set_animation_callback( &mut self, animation_callback: Option<impl Into<AnimationCallback<VertexShaderId, FragmentShaderId, ProgramId, UniformId, BufferId, AttributeId, TextureId, FramebufferId, TransformFeedbackId, VertexArrayObjectId, UserCtx>>>, )

Source

pub fn start_recording(&mut self)

Source

pub fn stop_recording(&self)

Source

pub fn clear_recorded_data(&self)

Source

pub fn recorder_initialized(&self) -> bool

Source

pub fn is_animating(&self) -> bool

Source

pub fn is_recording(&self) -> bool

Source

pub fn canvas(&self) -> HtmlCanvasElement

Source

pub fn gl(&self) -> WebGl2RenderingContext

Source

pub fn fragment_shader( &self, fragment_shader_id: &FragmentShaderId, ) -> Option<WebGlShader>

Source

pub fn vertex_shader( &self, vertex_shader_id: &VertexShaderId, ) -> Option<WebGlShader>

Source

pub fn program(&self, program_id: &ProgramId) -> Option<WebGlProgram>

Source

pub fn uniform( &self, uniform_id: &UniformId, ) -> Option<Uniform<ProgramId, UniformId>>

Source

pub fn buffer(&self, buffer_id: &BufferId) -> Option<Buffer<BufferId>>

Source

pub fn attribute( &self, attribute_id: &AttributeId, ) -> Option<Attribute<VertexArrayObjectId, BufferId, AttributeId>>

Source

pub fn texture(&self, texture_id: &TextureId) -> Option<Texture<TextureId>>

Source

pub fn framebuffer( &self, framebuffer_id: &FramebufferId, ) -> Option<Framebuffer<FramebufferId>>

Source

pub fn transform_feedback( &self, transform_feedback_id: &TransformFeedbackId, ) -> Option<WebGlTransformFeedback>

Source

pub fn vao( &self, vao_id: &VertexArrayObjectId, ) -> Option<WebGlVertexArrayObject>

Source

pub fn user_ctx(&self) -> Option<UserCtx>

Source

pub fn use_program(&self, program_id: &ProgramId) -> &Self

Source

pub fn use_vao(&self, vao_id: &VertexArrayObjectId) -> &Self

Source

pub fn update_uniform(&self, uniform_id: &UniformId) -> &Self

Source

pub fn update_uniforms(&self) -> &Self

Source

pub fn render(&self) -> &Self

Source

pub fn save_image(&self)

Source

pub fn render_callback( &self, ) -> RenderCallback<VertexShaderId, FragmentShaderId, ProgramId, UniformId, BufferId, AttributeId, TextureId, FramebufferId, TransformFeedbackId, VertexArrayObjectId, UserCtx>

Trait Implementations§

Source§

impl Deref for RendererJs

Source§

type Target = Renderer<String, String, String, String, String, String, String, String, String, String, Object>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl DerefMut for RendererJs

Source§

fn deref_mut(&mut self) -> &mut RendererJsInner

Mutably dereferences the value.
Source§

impl From<Renderer<String, String, String, String, String, String, String, String, String, String, Object>> for RendererJs

Source§

fn from(js_renderer_handle_inner: RendererJsInner) -> Self

Converts to this type from the input type.
Source§

impl From<RendererDataJs> for RendererJs

Source§

fn from(renderer_data_js: RendererDataJs) -> Self

Converts to this type from the input type.
Source§

impl From<RendererJs> for JsValue

Source§

fn from(value: RendererJs) -> Self

Converts to this type from the input type.
Source§

impl FromWasmAbi for RendererJs

Source§

type Abi = u32

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Source§

unsafe fn from_abi(js: u32) -> Self

Recover a Self from Self::Abi. Read more
Source§

impl IntoWasmAbi for RendererJs

Source§

type Abi = u32

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> u32

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl LongRefFromWasmAbi for RendererJs

Source§

type Abi = u32

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRef<RendererJs>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl OptionFromWasmAbi for RendererJs

Source§

fn is_none(abi: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Source§

impl OptionIntoWasmAbi for RendererJs

Source§

fn none() -> Self::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
Source§

impl RefFromWasmAbi for RendererJs

Source§

type Abi = u32

The Wasm ABI type references to Self are recovered from.
Source§

type Anchor = RcRef<RendererJs>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.
Source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Source§

impl RefMutFromWasmAbi for RendererJs

Source§

type Abi = u32

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRefMut<RendererJs>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl TryFromJsValue for RendererJs

Source§

type Error = JsValue

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

fn try_from_js_value(value: JsValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl VectorFromWasmAbi for RendererJs

Source§

type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi

Source§

unsafe fn vector_from_abi(js: Self::Abi) -> Box<[RendererJs]>

Source§

impl VectorIntoJsValue for RendererJs

Source§

impl VectorIntoWasmAbi for RendererJs

Source§

impl WasmDescribe for RendererJs

Source§

impl WasmDescribeVector for RendererJs

Source§

impl SupportsConstructor for RendererJs

Source§

impl SupportsInstanceProperty for RendererJs

Source§

impl SupportsStaticProperty for RendererJs

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> 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> ReturnWasmAbi for T
where T: IntoWasmAbi,

Source§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
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.