[][src]Trait keeshond_datapack::DataPreparer

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

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

Required methods

pub fn prepare(&mut self, data: &mut T, id: DataId) -> U[src]

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

pub fn unprepare(&mut self, prepared: &mut U, id: DataId)[src]

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

Loading content...

Provided methods

pub fn reprepare(&mut self, data: &mut T, prepared: &mut U, id: DataId)[src]

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

Loading content...

Implementors

Loading content...