com.threed.jpct
Class Virtualizer

java.lang.Object
  extended by com.threed.jpct.Virtualizer

public class Virtualizer
extends java.lang.Object

A Virtualizer can help to save memory by storing data on disk instead of using the VM memory. If you want to use this feature, make sure that the app can access the disk and that enough space is available. Then assign an instance of this class to the TextureManager or an Object3D. For textures, call TextureManager.virtualize(Texture) on those textures that should be swapped to disk.
Creating a new instance of this will clean all previously stored data from disk. If you want to reuse the affected data anyway, you'll run into trouble...
It's mandatory to set the current context by calling setContext(Context) before assigning it to anything.


Constructor Summary
Virtualizer()
          Creates a new instance of the Virtualizer with no maximum size.
Virtualizer(int sizeInMb)
          Creates a new instance of the Virtualizer with an estimated maximum size.
 
Method Summary
 void cleanUp()
          Cleans up the Virtualizer.
 void finalize()
           
 void setContext(android.content.Context ctx)
          Sets the context (android.content.Context).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Virtualizer

public Virtualizer(int sizeInMb)
Creates a new instance of the Virtualizer with an estimated maximum size.

Parameters:
sizeInMb - the maximum size. It might exceed this size, but not by a huge amount.

Virtualizer

public Virtualizer()
Creates a new instance of the Virtualizer with no maximum size.

Method Detail

setContext

public void setContext(android.content.Context ctx)
Sets the context (android.content.Context). Without it, the Virtualizer can't work.

Parameters:
ctx - the context

cleanUp

public void cleanUp()
Cleans up the Virtualizer. This will delete virtualized (but not cached) files.


finalize

public void finalize()
Overrides:
finalize in class java.lang.Object