public class ModelLibrary extends AssetLibrary<ModelReaderSettings,AsyncModel>
AsyncModelentries| Constructor and Description |
|---|
ModelLibrary() |
ModelLibrary(boolean concurrent) |
ModelLibrary(boolean concurrent,
boolean soft) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(ModelReaderSettings assetKey,
AsyncModel asset)
Add an asset to the library.
|
boolean |
contains(java.lang.String id) |
void |
destroy(IGLApi glApi,
AsyncModel asyncModel)
Destroy the specified model from this
ModelLibrary |
void |
destroyAll(IGLApi glApi)
Destroy (unload + remove) all models from this
ModelLibrary |
void |
destroyUnreferenced(IGLApi glApi)
Destroy (unload + remove) unreferenced models from this
ModelLibrary |
AsyncModel |
get(java.lang.String id) |
ModelReaderSettings |
getKey(java.lang.String id) |
void |
onContextLost() |
AsyncModel |
remove(java.lang.String id)
Remove the
AsyncModel with the specified id. |
AsyncModel |
use(AssetManager assets,
ModelReaderSettings settings)
AsyncModel.release() must be called on the result returned when it's not used anymore. |
assets, clear, contains, get, getKey, getOrCreate, iterator, remove, removeValue, sizepublic ModelLibrary()
public ModelLibrary(boolean concurrent)
public ModelLibrary(boolean concurrent,
boolean soft)
public void add(ModelReaderSettings assetKey, AsyncModel asset) throws java.lang.IllegalArgumentException
AssetLibraryadd in class AssetLibrary<ModelReaderSettings,AsyncModel>assetKey - asset key, usually the loading informationasset - asset to store in the libraryjava.lang.IllegalArgumentException - when the asset is already in the librarypublic AsyncModel use(AssetManager assets, ModelReaderSettings settings)
AsyncModel.release() must be called on the result returned when it's not used anymore.assets - AssetManagersettings - ModelReaderSettings of the model to registerAsyncModel, with reference count incrementedpublic AsyncModel get(java.lang.String id)
id - name identifier for the keypublic ModelReaderSettings getKey(java.lang.String id)
id - name identifier for the keypublic AsyncModel remove(java.lang.String id)
id - name of the asset to removepublic boolean contains(java.lang.String id)
public final void destroyAll(IGLApi glApi)
ModelLibrarypublic final void destroyUnreferenced(IGLApi glApi)
ModelLibrarypublic final void destroy(IGLApi glApi, AsyncModel asyncModel)
ModelLibrarypublic final void onContextLost()
Bonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com