APIdia Launch Partner
Top Description Constructors Methods
com.badlogic.gdx.assets.loaders

public abstract Class AsynchronousAssetLoader<T, P extends AssetLoaderParameters<T>>

extends AssetLoader<T, P extends AssetLoaderParameters<T>>
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.assets.loaders.BitmapFontLoader, com.badlogic.gdx.assets.loaders.CubemapLoader, com.badlogic.gdx.assets.loaders.I18NBundleLoader, com.badlogic.gdx.assets.loaders.ModelLoader, com.badlogic.gdx.assets.loaders.MusicLoader, com.badlogic.gdx.assets.loaders.PixmapLoader, com.badlogic.gdx.assets.loaders.ShaderProgramLoader, com.badlogic.gdx.assets.loaders.SkinLoader, com.badlogic.gdx.assets.loaders.SoundLoader, com.badlogic.gdx.assets.loaders.TextureLoader, com.badlogic.gdx.graphics.g3d.particles.ParticleEffectLoader, com.badlogic.gdx.maps.tiled.BaseTiledMapLoader, com.badlogic.gdx.maps.tiled.TiledMapLoader
Imports
com.badlogic.gdx.assets.AssetLoaderParameters, .AssetManager, com.badlogic.gdx.files.FileHandle

Base class for asynchronous AssetLoader instances. Such loaders try to load parts of an OpenGL resource, like the Pixmap, on a separate thread to then load the actual resource on the thread the OpenGL context is active on.
Author
mzechner

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
loadAsync(AssetManager manager, String
the name of the asset to load
fileName
,
FileHandle
the resolved file to load
file
,
P
the parameters to use for loading the asset
parameter
)

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

public abstract T
loadSync(AssetManager manager, String fileName, FileHandle
the resolved file to load
file
,
P parameter)

Loads the OpenGL part of the asset.

public void
unloadAsync(AssetManager manager, String fileName, FileHandle file, P parameter)

Called if this task is unloaded before loadSync is called.

Inherited from com.badlogic.gdx.assets.loaders.AssetLoader:
getDependenciesresolve

Constructor Detail

AsynchronousAssetLoaderback to summary
public AsynchronousAssetLoader(FileHandleResolver resolver)

Method Detail

loadAsyncback to summary
public abstract void loadAsync(AssetManager manager, String fileName, FileHandle file, P parameter)

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

Parameters
fileName:String

the name of the asset to load

file:FileHandle

the resolved file to load

parameter:P

the parameters to use for loading the asset

loadSyncback to summary
public abstract T loadSync(AssetManager manager, String fileName, FileHandle file, P parameter)

Loads the OpenGL part of the asset.

Parameters
file:FileHandle

the resolved file to load

unloadAsyncback to summary
public void unloadAsync(AssetManager manager, String fileName, FileHandle file, P parameter)

Called if this task is unloaded before loadSync is called. This method may be invoked on any thread, but will not be invoked during or after loadSync. This method is not invoked when a task is cancelled because it threw an exception, only when the asset is unloaded before loading is complete.

The default implementation does nothing. Subclasses should release any resources acquired in loadAsync, which may or may not have been called before this method, but never during or after this method. Note that loadAsync may still be executing when this method is called and must release any resources it allocated.