pub struct DataTexture(/* private fields */);Expand description
Cloning is a handle copy, as in JS.
Implementations§
Source§impl DataTexture
impl DataTexture
Sourcepub fn dispose(self)
pub fn dispose(self)
dataTexture.dispose() — drops this handle, and nothing more: a texture
handle is an Rc, so the renderer frees the GPU side once every handle
is gone, at the top of the next render (docs/scene-graph.md,
“Identity and eviction”). Dropping the handle does the same; this
exists so three.js code ports line for line.
Sourcepub fn new_f32(data: Vec<f32>, width: u32, height: u32) -> Self
pub fn new_f32(data: Vec<f32>, width: u32, height: u32) -> Self
new DataTexture( new Float32Array( w * h * 4 ), w, h, RGBAFormat, FloatType ).
Sourcepub fn new_u32(data: Vec<u32>, width: u32, height: u32) -> Self
pub fn new_u32(data: Vec<u32>, width: u32, height: u32) -> Self
new DataTexture( new Uint32Array( w * h ), w, h, RedIntegerFormat, UnsignedIntType ).
Sourcepub fn borrow(&self) -> Ref<'_, DataTextureInner>
pub fn borrow(&self) -> Ref<'_, DataTextureInner>
Borrows the texture’s data, width and height.
Sourcepub fn set_needs_update(&self)
pub fn set_needs_update(&self)
texture.needsUpdate = true.
Sourcepub fn with_f32_mut<R>(&self, f: impl FnOnce(&mut [f32]) -> R) -> R
pub fn with_f32_mut<R>(&self, f: impl FnOnce(&mut [f32]) -> R) -> R
Edit the float payload in place and bump the version.
Sourcepub fn with_u32_mut<R>(&self, f: impl FnOnce(&mut [u32]) -> R) -> R
pub fn with_u32_mut<R>(&self, f: impl FnOnce(&mut [u32]) -> R) -> R
Edit the uint payload in place and bump the version.
Trait Implementations§
Source§impl Clone for DataTexture
impl Clone for DataTexture
Auto Trait Implementations§
impl !RefUnwindSafe for DataTexture
impl !Send for DataTexture
impl !Sync for DataTexture
impl !UnwindSafe for DataTexture
impl Freeze for DataTexture
impl Unpin for DataTexture
impl UnsafeUnpin for DataTexture
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