de.javagl.swogl
Interface Texture


public interface Texture

Interface for the texture of a SwoglComponent. This interface only maintains a BufferedImage and an associated 'dirty' rectangle. When the image contents is modified, the respective region may be marked as 'dirty', and will be updated at the beginning of the next rendering pass.


Method Summary
 void addDirtyRectangle(java.awt.Rectangle rectangle)
          Add the given dirty rectangle to this texture.
 void clearDirtyRectangle()
          Clear the current dirty rectangle.
 java.awt.Rectangle getDirtyRectangle()
          Returns a copy of the current dirty rectangle.
 java.awt.image.BufferedImage getImage()
          Return the BufferedImage backing this texture.
 

Method Detail

getImage

java.awt.image.BufferedImage getImage()
Return the BufferedImage backing this texture.

Note: Some renderers may assume that the image is backed by a DataBufferInt, and thus has to be TYPE_INT_RGB or TYPE_INT_ARGB.

Returns:
The BufferedImage backing this texture

addDirtyRectangle

void addDirtyRectangle(java.awt.Rectangle rectangle)
Add the given dirty rectangle to this texture. That is, the given rectangle will be merged with any dirty rectangle that may already be present.

Parameters:
rectangle - The dirty rectangle

getDirtyRectangle

java.awt.Rectangle getDirtyRectangle()
Returns a copy of the current dirty rectangle. Returns null if there is no rectangle marked as 'dirty'

Returns:
A copy of the current dirty rectangle, or null.

clearDirtyRectangle

void clearDirtyRectangle()
Clear the current dirty rectangle.