pub trait DataPreparer<T: DataObject + 'static, U> {
    fn prepare(&mut self, data: &mut T, id: DataId<T>) -> U;
fn unprepare(&mut self, prepared: &mut U, id: DataId<T>); fn reprepare(&mut self, data: &mut T, prepared: &mut U, id: DataId<T>) { ... } }
Expand description

Used with PreparedStore, this allows the definition of behavior when initializing resources with a backend. See PreparedStore for more information.

Required methods

Called when data has been loaded but not “prepared” yet. You can use this, for example, to load textures onto the GPU.

Called when data has been unloaded recently and should be cleared in the backend. For example, use this to unload textures from GPU memory.

Provided methods

Called when data is already loaded but needs to be “reprepared”. You can use this, for example, to update existing textures on the GPU.

Implementors