Class AsynchronousAssetLoader<T,​P extends AssetLoaderParameters<T>>

    • Constructor Detail

      • AsynchronousAssetLoader

        public AsynchronousAssetLoader​(FileHandleResolver resolver)
    • Method Detail

      • loadAsync

        public abstract void loadAsync​(AssetManager manager,
                                       java.lang.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
      • unloadAsync

        public void unloadAsync​(AssetManager manager,
                                java.lang.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.

      • loadSync

        public abstract T loadSync​(AssetManager manager,
                                   java.lang.String fileName,
                                   FileHandle file,
                                   P parameter)
        Loads the OpenGL part of the asset.
        Parameters:
        manager -
        fileName -
        file - the resolved file to load
        parameter -