Struct sixtyfps_corelib::graphics::RenderingCache[][src]

pub struct RenderingCache<T> { /* fields omitted */ }
Expand description

The RenderingCache, in combination with CachedGraphicsData, allows back ends to store data that’s either intensive to compute or has bad CPU locality. Back ends typically keep a RenderingCache instance and use the item’s cached_rendering_data() integer as index in the vec_arena::Arena.

Implementations

Returns the generation of the cache. The generation starts at 1 and is increased whenever the cache is cleared, for example when the GL context is lost.

Retrieves a mutable reference to the cached graphics data at index.

Returns true if a cache entry exists for the given index.

Inserts data into the cache and returns the index for retrieval later.

Retrieves an immutable reference to the cached graphics data at index.

Removes the cached graphics data at the given index.

Removes all entries from the cache and increases the cache’s generation count, so that stale index access can be avoided.

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

Performs the conversion.

Performs the conversion.

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.