protected class TextureAtlas.AtlasBackingStore extends java.lang.Object implements BackingStoreManager
RectanglePacker
, and delegates calls from a JOGL rectangle packer to methods in this texture atlas.Modifier | Constructor and Description |
---|---|
protected |
AtlasBackingStore() |
Modifier and Type | Method and Description |
---|---|
boolean |
additionFailed(Rect cause,
int attemptNumber)
If this texture atlas is configured to evicts old elements, this attempts to remove the oldest one then
exits, allowing the caller to attempt the addition again.
|
java.lang.Object |
allocateBackingStore(int w,
int h)
Calls
TextureAtlas.createBackingImage(int, int) with the specified width and height. |
void |
beginMovement(java.lang.Object oldBackingStore,
java.lang.Object newBackingStore)
Calls
TextureAtlas.beginMoveEntries(java.awt.image.BufferedImage, java.awt.image.BufferedImage) ,
casting the specified backing stores to BufferedImages. |
boolean |
canCompact()
Returns
true . |
void |
deleteBackingStore(java.lang.Object backingStore)
|
void |
endMovement(java.lang.Object oldBackingStore,
java.lang.Object newBackingStore)
Calls
TextureAtlas.endMoveEntries(java.awt.image.BufferedImage, java.awt.image.BufferedImage) ,
casting the specified backing stores to BufferedImages. |
void |
move(java.lang.Object oldBackingStore,
Rect oldLocation,
java.lang.Object newBackingStore,
Rect newLocation)
Calls
TextureAtlas.moveEntry(java.awt.image.BufferedImage, com.jogamp.opengl.util.packrect.Rect,
java.awt.image.BufferedImage, com.jogamp.opengl.util.packrect.Rect) , casting the specified backing stores to
BufferedImages. |
boolean |
preExpand(Rect cause,
int attemptNumber)
Returns
false , indicating that the rectangle packer should just expand. |
public boolean additionFailed(Rect cause, int attemptNumber)
additionFailed
in interface BackingStoreManager
WWRuntimeException
- if this backing store cannot fit the rectangle in its layout.public java.lang.Object allocateBackingStore(int w, int h)
TextureAtlas.createBackingImage(int, int)
with the specified width and height.allocateBackingStore
in interface BackingStoreManager
public void beginMovement(java.lang.Object oldBackingStore, java.lang.Object newBackingStore)
TextureAtlas.beginMoveEntries(java.awt.image.BufferedImage, java.awt.image.BufferedImage)
,
casting the specified backing stores to BufferedImages.beginMovement
in interface BackingStoreManager
public boolean canCompact()
true
. The texture atlas can always attempt to expand or compact.canCompact
in interface BackingStoreManager
public void deleteBackingStore(java.lang.Object backingStore)
deleteBackingStore
in interface BackingStoreManager
public void endMovement(java.lang.Object oldBackingStore, java.lang.Object newBackingStore)
TextureAtlas.endMoveEntries(java.awt.image.BufferedImage, java.awt.image.BufferedImage)
,
casting the specified backing stores to BufferedImages.endMovement
in interface BackingStoreManager
public void move(java.lang.Object oldBackingStore, Rect oldLocation, java.lang.Object newBackingStore, Rect newLocation)
TextureAtlas.moveEntry(java.awt.image.BufferedImage, com.jogamp.opengl.util.packrect.Rect,
java.awt.image.BufferedImage, com.jogamp.opengl.util.packrect.Rect)
, casting the specified backing stores to
BufferedImages.move
in interface BackingStoreManager
public boolean preExpand(Rect cause, int attemptNumber)
false
, indicating that the rectangle packer should just expand. When configured to do
so, texture atlas evicts old elements in additionFailed
if this texture atlas is full and the
addition would otherwise fail.preExpand
in interface BackingStoreManager