pub struct DynamicTexture { /* private fields */ }Expand description
A copyable handle to a mutable texture, not an owner of its GPU memory.
Applications obtain uploaded textures from
crate::Window::create_dynamic_texture. Renderer crates can register
GPU-written textures with Self::new_gpu and own their GPU memory.
Removing a texture retires every copy of its handle.
Implementations§
Source§impl DynamicTexture
impl DynamicTexture
Sourcepub fn id(&self) -> DynamicTextureId
pub fn id(&self) -> DynamicTextureId
Identifies the texture in its renderer’s lookup table. This is not a GPU resource or an ownership token.
Sourcepub fn new_gpu(size: Size<DevicePixels>) -> Result<Self>
pub fn new_gpu(size: Size<DevicePixels>) -> Result<Self>
Registers the size and version of a GPU-written texture.
Renderer crates allocate and own its GPU memory on their own context. Applications should use their renderer’s constructor. This method never selects or calls the process’s upload platform.
Sourcepub fn remove(self)
pub fn remove(self)
Releases the texture without requiring a live window, for example when the producer is dropped. Other copies of the handle become stale. Releasing an already removed texture has no effect. Renderer owners must also release GPU memory held outside the upload platform; this method retires only the metadata of GPU-written textures.
Trait Implementations§
Source§impl Clone for DynamicTexture
impl Clone for DynamicTexture
impl Copy for DynamicTexture
Source§impl Debug for DynamicTexture
impl Debug for DynamicTexture
impl Eq for DynamicTexture
Source§impl PartialEq for DynamicTexture
impl PartialEq for DynamicTexture
impl StructuralPartialEq for DynamicTexture
Auto Trait Implementations§
impl Forget for DynamicTexture
impl Freeze for DynamicTexture
impl RefUnwindSafe for DynamicTexture
impl Send for DynamicTexture
impl Sync for DynamicTexture
impl Unpin for DynamicTexture
impl UnsafeUnpin for DynamicTexture
impl UnwindSafe for DynamicTexture
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more