com.badlogic.gdx.assets.loaders
Class AsynchronousAssetLoader<T,P extends AssetLoaderParameters<T>>

java.lang.Object
  extended by com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
      extended by com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<T,P>
Type Parameters:
T -
P -
Direct Known Subclasses:
AtlasTmxMapLoader, BitmapFontLoader, ModelLoader, MusicLoader, PixmapLoader, SkinLoader, SoundLoader, TextureLoader, TmxMapLoader

public abstract class AsynchronousAssetLoader<T,P extends AssetLoaderParameters<T>>
extends AssetLoader<T,P>

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
AsynchronousAssetLoader(FileHandleResolver resolver)
           
 
Method Summary
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.
abstract  T loadSync(AssetManager manager, String fileName, FileHandle file, P parameter)
          Loads the OpenGL part of the asset.
 
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
getDependencies, resolve
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchronousAssetLoader

public AsynchronousAssetLoader(FileHandleResolver resolver)
Method Detail

loadAsync

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:
manager -
fileName - the name of the asset to load
file - the resolved file to load
parameter - the parameters to use for loading the asset

loadSync

public abstract T loadSync(AssetManager manager,
                           String fileName,
                           FileHandle file,
                           P parameter)
Loads the OpenGL part of the asset.

Parameters:
manager -
fileName -
file - the resolved file to load
parameter -


Copyright © 2013. All Rights Reserved.