aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/texture/awt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-05-08 03:49:55 +0200
committerSven Gothel <[email protected]>2013-05-08 03:49:55 +0200
commitff08ebae2f6ed8788d481f4a21fc7a07a75733ee (patch)
tree9afe3ea4c5fc4df2e5dd3b91c6de17fb4fc2800b /src/jogl/classes/com/jogamp/opengl/util/texture/awt
parentda8717097df2afba3fc7e9ef648ce6bc4ebd4f9f (diff)
GLJPanel: Use PixelBufferProvider AWTPixelBufferProviderInt; PixelBufferProvider: Add 'dispose()' to interface.
Transition reusing AWT specific PixelBufferProvider to allow a later user provided PixelBufferProvider.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/texture/awt')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
index d77bd835e..7a0f00edf 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
@@ -104,11 +104,22 @@ public class AWTTextureData extends TextureData {
return IntBuffer.wrap( readBackIntBuffer );
}
+ @Override
+ public void dispose() {
+ if(null != image) {
+ image.flush();
+ image = null;
+ }
+ }
+
/** Returns the number source components being used as indicated at {@link #allocate(int, int, int)}. */
public int getComponentCount() { return componentCount; }
/** Returns the underlying {@link BufferedImage} as allocated via {@link #allocate(int, int, int)}. */
public BufferedImage getImage() { return image; }
+
+ /** Returns true if an underlying {@link BufferedImage} has been allocated via {@link #allocate(int, int, int)}. */
+ public boolean hasImage() { return null != image; }
}
// Mechanism for lazily converting input BufferedImages with custom