pub struct TextureManager { /* private fields */ }
Expand description

Low-level manager for allocating textures.

Communicates with the painting subsystem using Self::take_delta.

Implementations

Allocate a new texture.

The given name can be useful for later debugging.

The returned TextureId will be TextureId::Managed, with an index starting from zero and increasing with each call to Self::alloc.

The first texture you allocate will be TextureId::Managed(0) == TexureId::default() and MUST have a white pixel at (0,0) (crate::WHITE_UV).

The texture is given a retain-count of 1, requiring one call to Self::free to free it.

Assign a new image to an existing texture, or update a region of it.

Free an existing texture.

Increase the retain-count of the given texture.

For each time you call Self::retain you must call Self::free on additional time.

Take and reset changes since last frame.

These should be applied to the painting subsystem each frame.

Get meta-data about a specific texture.

Get meta-data about all allocated textures in some arbitrary order.

Total number of allocated textures.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.