|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.util.NativeObject
public abstract class NativeObject
Describes a native object. An encapsulation of a certain object on the native side of the graphics or audio library. This class is used to track when OpenGL and OpenAL native objects are collected by the garbage collector, and then invoke the proper destructor on the OpenGL library to delete it from memory.
Field Summary | |
---|---|
protected java.lang.Object |
handleRef
A reference to a "handle". |
protected int |
id
The ID of the object, usually depends on its type. |
protected java.lang.Class<?> |
type
The type of the GLObject, usually specified by a subclass. |
protected boolean |
updateNeeded
True if the data represented by this GLObject has been changed and needs to be updated before used. |
Constructor Summary | |
---|---|
|
NativeObject(java.lang.Class<?> type)
Creates a new GLObject with the given type. |
protected |
NativeObject(java.lang.Class<?> type,
int id)
Protected constructor that doesn't allocate handle ref. |
Method Summary | |
---|---|
void |
clearUpdateNeeded()
Internal use only. |
protected NativeObject |
clone()
This should create a deep clone. |
abstract NativeObject |
createDestructableClone()
Creates a shallow clone of this GL Object. |
abstract void |
deleteObject(java.lang.Object rendererObject)
Deletes the GL object from the GPU when it is no longer used. |
int |
getId()
|
boolean |
isUpdateNeeded()
Internal use only. |
abstract void |
resetObject()
Called when the GL context is restarted to reset all IDs. |
void |
setId(int id)
Sets the ID of the GLObject. |
void |
setUpdateNeeded()
Internal use only. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int id
protected java.lang.Object handleRef
protected boolean updateNeeded
protected final java.lang.Class<?> type
Constructor Detail |
---|
public NativeObject(java.lang.Class<?> type)
type
- The type that the subclass represents.protected NativeObject(java.lang.Class<?> type, int id)
Method Detail |
---|
public void setId(int id)
id
- The ID to setpublic int getId()
public void setUpdateNeeded()
public void clearUpdateNeeded()
public boolean isUpdateNeeded()
setUpdateNeeded()
was called before.
public java.lang.String toString()
toString
in class java.lang.Object
protected NativeObject clone()
clone
in class java.lang.Object
public abstract void resetObject()
public abstract void deleteObject(java.lang.Object rendererObject)
rendererObject
- The renderer to be used to delete the objectpublic abstract NativeObject createDestructableClone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |