pub struct RendererDataBuilderJs(/* private fields */);Expand description
Implementations§
Source§impl RendererDataBuilderJs
impl RendererDataBuilderJs
pub fn texture(&self, texture_id: String) -> Option<TextureJs>
pub fn set_canvas(&mut self, canvas: HtmlCanvasElement)
pub fn add_fragment_shader_src( &mut self, id: String, fragment_shader_src: String, )
pub fn add_vertex_shader_src(&mut self, id: String, vertex_shader_src: String)
pub fn add_program_link(&mut self, program_link: ProgramLinkJs)
pub fn set_render_callback(&mut self, render_callback: RenderCallbackJs)
pub fn set_user_ctx(&mut self, ctx: Object)
pub fn add_uniform_link(&mut self, uniform_link: UniformLinkJs)
pub fn add_buffer_link(&mut self, buffer_link: BufferLinkJs)
pub fn add_attribute_link(&mut self, attribute_link: AttributeLinkJs)
pub fn add_texture_link(&mut self, texture_link: TextureLinkJs)
pub fn add_framebuffer_link(&mut self, framebuffer_link: FramebufferLinkJs)
pub fn add_transform_feedback_link( self, transform_feedback_link: TransformFeedbackLinkJs, )
pub fn add_vao_link(&mut self, vertex_array_object_id: String)
pub fn set_get_context_callback(&mut self, get_context_callback: Function)
pub fn build_renderer_data(self) -> Result<RendererDataJs, String>
pub fn build_renderer(self) -> Result<RendererJs, String>
Methods from Deref<Target = RendererDataBuilder<String, String, String, String, String, String, String, String, String, String, Object>>§
Sourcepub fn texture(&self, texture_id: &TextureId) -> Option<&Texture<TextureId>>
pub fn texture(&self, texture_id: &TextureId) -> Option<&Texture<TextureId>>
This is the only internal storage available publicly from the builder, because it is necessary to use it during the build process for framebuffers.
Sourcepub fn set_canvas(&mut self, canvas: HtmlCanvasElement) -> &mut Self
pub fn set_canvas(&mut self, canvas: HtmlCanvasElement) -> &mut Self
Save the canvas that will be rendered to and get its associated WebGL2 rendering context
Sourcepub fn add_fragment_shader_src(
&mut self,
id: FragmentShaderId,
fragment_shader_src: impl Into<String>,
) -> &mut Self
pub fn add_fragment_shader_src( &mut self, id: FragmentShaderId, fragment_shader_src: impl Into<String>, ) -> &mut Self
Saves a fragment shader source and its corresponding id
Sourcepub fn add_vertex_shader_src(
&mut self,
id: VertexShaderId,
vertex_shader_src: impl Into<String>,
) -> &mut Self
pub fn add_vertex_shader_src( &mut self, id: VertexShaderId, vertex_shader_src: impl Into<String>, ) -> &mut Self
Saves a vertex shader source and its corresponding id
Sourcepub fn add_program_link(
&mut self,
program_link: impl Into<ProgramLink<ProgramId, VertexShaderId, FragmentShaderId>>,
) -> &mut Self
pub fn add_program_link( &mut self, program_link: impl Into<ProgramLink<ProgramId, VertexShaderId, FragmentShaderId>>, ) -> &mut Self
Saves a link between a vertex shader id and a fragment shader id.
During the RendererData build process, this program_link is used to link a new WebGL2 program
together by associating the vertex shader id and the fragment shader id with their corresponding compiled shaders.
pub fn add_program_links( &mut self, program_links: impl Into<Bridge<ProgramLink<ProgramId, VertexShaderId, FragmentShaderId>>>, ) -> &mut Self
Sourcepub fn set_render_callback(
&mut self,
render_callback: impl Into<RenderCallback<VertexShaderId, FragmentShaderId, ProgramId, UniformId, BufferId, AttributeId, TextureId, FramebufferId, TransformFeedbackId, VertexArrayObjectId, UserCtx>>,
) -> &mut Self
pub fn set_render_callback( &mut self, render_callback: impl Into<RenderCallback<VertexShaderId, FragmentShaderId, ProgramId, UniformId, BufferId, AttributeId, TextureId, FramebufferId, TransformFeedbackId, VertexArrayObjectId, UserCtx>>, ) -> &mut Self
Save a callback that will be called each time it is time to render a new frame
Sourcepub fn set_user_ctx(&mut self, ctx: impl Into<UserCtx>) -> &mut Self
pub fn set_user_ctx(&mut self, ctx: impl Into<UserCtx>) -> &mut Self
Save as arbitrary user context that can be accessed from within the render callback
This can include stateful data and anything else that might be necessary to access while performing a render.
Sourcepub fn add_uniform_link(
&mut self,
uniform_link: impl Into<UniformLink<ProgramId, UniformId>>,
) -> &mut Self
pub fn add_uniform_link( &mut self, uniform_link: impl Into<UniformLink<ProgramId, UniformId>>, ) -> &mut Self
Saves a link that will be used to build a uniform at build time.
I.e. once all WebGL shaders are compiled and all programs are linked, all uniforms will be found within their associated programs, and will be saved with their associated update functions.
pub fn add_uniform_links( &mut self, uniform_links: impl Into<Bridge<UniformLink<ProgramId, UniformId>>>, ) -> &mut Self
Sourcepub fn add_buffer_link(
&mut self,
buffer_link: impl Into<BufferLink<BufferId>>,
) -> &mut Self
pub fn add_buffer_link( &mut self, buffer_link: impl Into<BufferLink<BufferId>>, ) -> &mut Self
Saves a link that will be used to build a WebGL buffer at build time.
pub fn add_buffer_links( &mut self, buffer_links: impl Into<Bridge<BufferLink<BufferId>>>, ) -> &mut Self
Sourcepub fn add_attribute_link(
&mut self,
attribute_link: impl Into<AttributeLink<VertexArrayObjectId, BufferId, AttributeId>>,
) -> &mut Self
pub fn add_attribute_link( &mut self, attribute_link: impl Into<AttributeLink<VertexArrayObjectId, BufferId, AttributeId>>, ) -> &mut Self
Saves a link that will be used to build a a WebGL attribute at build time.
pub fn add_attribute_links( &mut self, attribute_links: impl Into<Bridge<AttributeLink<VertexArrayObjectId, BufferId, AttributeId>>>, ) -> &mut Self
Sourcepub fn add_texture_link(
&mut self,
texture_link: impl Into<TextureLink<TextureId>>,
) -> &mut Self
pub fn add_texture_link( &mut self, texture_link: impl Into<TextureLink<TextureId>>, ) -> &mut Self
Saves a link that will be used to build a buffer/attribute pair at build time.
pub fn add_texture_links( &mut self, texture_links: impl Into<Bridge<TextureLink<TextureId>>>, ) -> &mut Self
Sourcepub fn add_framebuffer_link(
&mut self,
framebuffer_link: impl Into<FramebufferLink<FramebufferId, TextureId>>,
) -> &mut Self
pub fn add_framebuffer_link( &mut self, framebuffer_link: impl Into<FramebufferLink<FramebufferId, TextureId>>, ) -> &mut Self
Saves a link that will be used to build a framebuffer at build time
pub fn add_framebuffer_links( &mut self, framebuffer_links: impl Into<Bridge<FramebufferLink<FramebufferId, TextureId>>>, ) -> &mut Self
Sourcepub fn add_transform_feedback_link(
&mut self,
transform_feedback_link: impl Into<TransformFeedbackLink<TransformFeedbackId>>,
) -> &mut Self
pub fn add_transform_feedback_link( &mut self, transform_feedback_link: impl Into<TransformFeedbackLink<TransformFeedbackId>>, ) -> &mut Self
Saves a link that will be used to build a transformFeedback at build time
pub fn add_transform_feedback_links( &mut self, transform_feedback_links: impl Into<Bridge<TransformFeedbackLink<TransformFeedbackId>>>, ) -> &mut Self
Sourcepub fn add_vao_link(
&mut self,
vertex_array_object_id: impl Into<VertexArrayObjectId>,
) -> &mut Self
pub fn add_vao_link( &mut self, vertex_array_object_id: impl Into<VertexArrayObjectId>, ) -> &mut Self
Saves an id that will be used to create a VAO at build time
This VAO can then be referenced by AttributeLinks
pub fn add_vao_links( &mut self, vao_links: impl Into<Bridge<VertexArrayObjectId>>, ) -> &mut Self
pub fn set_get_context_callback( &mut self, get_context_callback: impl Into<GetContextCallback>, ) -> &mut Self
Trait Implementations§
Source§impl Default for RendererDataBuilderJs
impl Default for RendererDataBuilderJs
Source§impl Deref for RendererDataBuilderJs
impl Deref for RendererDataBuilderJs
Source§impl DerefMut for RendererDataBuilderJs
impl DerefMut for RendererDataBuilderJs
Source§impl From<RendererDataBuilderJs> for JsValue
impl From<RendererDataBuilderJs> for JsValue
Source§fn from(value: RendererDataBuilderJs) -> Self
fn from(value: RendererDataBuilderJs) -> Self
Source§impl FromWasmAbi for RendererDataBuilderJs
impl FromWasmAbi for RendererDataBuilderJs
Source§impl IntoWasmAbi for RendererDataBuilderJs
impl IntoWasmAbi for RendererDataBuilderJs
Source§impl RefFromWasmAbi for RendererDataBuilderJs
impl RefFromWasmAbi for RendererDataBuilderJs
Source§type Anchor = RcRef<RendererDataBuilderJs>
type Anchor = RcRef<RendererDataBuilderJs>
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§impl VectorFromWasmAbi for RendererDataBuilderJs
impl VectorFromWasmAbi for RendererDataBuilderJs
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[RendererDataBuilderJs]>
Source§impl VectorIntoWasmAbi for RendererDataBuilderJs
impl VectorIntoWasmAbi for RendererDataBuilderJs
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[RendererDataBuilderJs]>) -> Self::Abi
Source§impl WasmDescribeVector for RendererDataBuilderJs
impl WasmDescribeVector for RendererDataBuilderJs
impl SupportsConstructor for RendererDataBuilderJs
impl SupportsInstanceProperty for RendererDataBuilderJs
impl SupportsStaticProperty for RendererDataBuilderJs
Auto Trait Implementations§
impl Freeze for RendererDataBuilderJs
impl !RefUnwindSafe for RendererDataBuilderJs
impl !Send for RendererDataBuilderJs
impl !Sync for RendererDataBuilderJs
impl Unpin for RendererDataBuilderJs
impl !UnwindSafe for RendererDataBuilderJs
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.