Struct maia_wasm::render::VaoBuilder
source · pub struct VaoBuilder<'a> { /* private fields */ }Expand description
WebGL2 VAO builder.
This builder object is used to create a new Vertex Array Object or modify an existing one.
Implementations§
source§impl<'a> VaoBuilder<'a>
impl<'a> VaoBuilder<'a>
sourcepub fn create_array_buffer<T: ArrayView>(
self,
program: &WebGlProgram,
attribute: &str,
size: i32,
contents: &[T]
) -> Result<Self, JsValue>
pub fn create_array_buffer<T: ArrayView>( self, program: &WebGlProgram, attribute: &str, size: i32, contents: &[T] ) -> Result<Self, JsValue>
Adds or modifies an array buffer to the VAO.
This function creates a WebGL2 buffer, fills it with the array
contents, and associates it with the VAO being built or modified,
associating it to a given attribute in a WebGL2 program.
sourcepub fn create_element_array_buffer(
self,
contents: &[u16]
) -> Result<Self, JsValue>
pub fn create_element_array_buffer( self, contents: &[u16] ) -> Result<Self, JsValue>
Adds or modifies an element array buffer to the VAO.
This function creates a WebGL2 buffer, fills it with the array
contents, and associates it with the VAO as an element array buffer.
sourcepub fn build(self) -> Rc<WebGlVertexArrayObject>
pub fn build(self) -> Rc<WebGlVertexArrayObject>
Builds the VAO.
Finishes the construction of the VAO, returning the VAO object.
Auto Trait Implementations§
impl<'a> Freeze for VaoBuilder<'a>
impl<'a> !RefUnwindSafe for VaoBuilder<'a>
impl<'a> !Send for VaoBuilder<'a>
impl<'a> !Sync for VaoBuilder<'a>
impl<'a> Unpin for VaoBuilder<'a>
impl<'a> !UnwindSafe for VaoBuilder<'a>
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
Mutably borrows from an owned value. Read more