|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.iutil.TextureUpdateStateManager
public class TextureUpdateStateManager
Class that handles all of the update state messaging in a cross between a listener and a traditional HashMap.
Since the state manager manages update requests keyed by GL context, if an update is recieved before the context has been registered with the map, then they will disappear. This is particularly important if you are attempting to make texture updates prior to the first frame rendering or if an update is called on the first call of the app update observer.
Field Summary | |
---|---|
static int |
UPDATE_BUFFER_ALL
All sub image updates should be buffered until the next chance to update. |
static int |
UPDATE_BUFFER_LAST
Each update should discard any previous updates recieved. |
static int |
UPDATE_DISCARD_OVERWRITES
Each update should check to see whether the area of this update overlaps completely that of any other buffered updates. |
Constructor Summary | |
---|---|
TextureUpdateStateManager(int strategy)
Create a new state manager using the given strategy. |
|
TextureUpdateStateManager(int strategy,
int initialCapacity,
float loadFactor)
Create a new instance of the updater. |
Method Summary | |
---|---|
void |
addContext(javax.media.opengl.GL gl)
Register a new context instance with this manager. |
void |
clear()
Clears this manager so that it contains no keys. |
void |
clearPendingUpdates()
Convenience method to empty the current pending updates list and drop the values into the cache. |
int |
getNumUpdatesPending(javax.media.opengl.GL gl)
Returns the number of updates that are pending for a given context. |
TextureUpdateData[] |
getUpdatesAndClear(javax.media.opengl.GL gl)
Returns an array holding all the pending updates for the given GL context and resets the number pending back to 0. |
boolean |
isEmpty()
Check to see if if this manager contains no current contexts registered. |
void |
removeContext(javax.media.opengl.GL gl)
Removes the context (and its corresponding updates) from the manager. |
void |
setTextureFormat(int f)
Set the new texture format to use. |
void |
setUpdateStrategy(int strategy)
Change the update strategy to use. |
int |
size()
Returns the number of contexts current registered in this manager. |
void |
textureUpdated(int x,
int y,
int z,
int width,
int height,
int depth,
int level,
byte[] pixels)
Notification that the texture has updated a section of the texture. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UPDATE_BUFFER_ALL
public static final int UPDATE_BUFFER_LAST
public static final int UPDATE_DISCARD_OVERWRITES
Constructor Detail |
---|
public TextureUpdateStateManager(int strategy)
strategy
- one of the UPDATE_ identifierspublic TextureUpdateStateManager(int strategy, int initialCapacity, float loadFactor)
strategy
- one of the UPDATE_ identifiersinitialCapacity
- the initial capacity of the hashtable.loadFactor
- the load factor of the underlying hashtable.Method Detail |
---|
public void textureUpdated(int x, int y, int z, int width, int height, int depth, int level, byte[] pixels)
textureUpdated
in interface SubTextureUpdateListener
x
- The start location x coordinate in texel spacey
- The start location y coordinate in texel spacez
- The start location z coordinate in texel spacewidth
- The width of the update in texel spaceheight
- The height of the update in texel spacedepth
- The depth of the update in texel spacelevel
- The mipmap level that changedpixels
- Buffer of the data that has updatedpublic int size()
public boolean isEmpty()
public void setTextureFormat(int f)
f
- The format type to usepublic void setUpdateStrategy(int strategy)
strategy
- The new update typepublic int getNumUpdatesPending(javax.media.opengl.GL gl)
gl
- The GL context to fetch the update array for
public TextureUpdateData[] getUpdatesAndClear(javax.media.opengl.GL gl)
gl
- The GL context to fetch the update array for
public void addContext(javax.media.opengl.GL gl)
gl
- The GL context to remove as a keypublic void removeContext(javax.media.opengl.GL gl)
gl
- The GL context to remove as a keypublic void clear()
public void clearPendingUpdates()
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |