com.jme3.util
Class NativeObjectManager

java.lang.Object
  extended by com.jme3.util.NativeObjectManager

public class NativeObjectManager
extends java.lang.Object

GLObjectManager tracks all GLObjects used by the Renderer. Using a ReferenceQueue the GLObjectManager can delete unused objects from GPU when their counterparts on the CPU are no longer used. On restart, the renderer may request the objects to be reset, thus allowing the GLObjects to re-initialize with the new display context.


Constructor Summary
NativeObjectManager()
           
 
Method Summary
 void deleteAllObjects(java.lang.Object rendererObject)
          Deletes all objects.
 void deleteUnused(java.lang.Object rendererObject)
          Deletes unused NativeObjects.
 void registerForCleanup(NativeObject obj)
          Register a GLObject with the manager.
 void resetObjects()
          Resets all NativeObjects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeObjectManager

public NativeObjectManager()
Method Detail

registerForCleanup

public void registerForCleanup(NativeObject obj)
Register a GLObject with the manager.


deleteUnused

public void deleteUnused(java.lang.Object rendererObject)
Deletes unused NativeObjects. Will delete at most MAX_REMOVES_PER_FRAME objects.

Parameters:
rendererObject - The renderer object. For graphics objects, Renderer is used, for audio, {#link AudioRenderer} is used.

deleteAllObjects

public void deleteAllObjects(java.lang.Object rendererObject)
Deletes all objects. Must only be called when display is destroyed.


resetObjects

public void resetObjects()
Resets all NativeObjects.