From 5b543c792f28e79e1b15da6747e68d9e0f5c8ce9 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 31 Mar 2007 02:35:25 +0000 Subject: Added msg.jar target. Added dispose() method to Texture2. Fixed small bug just introduced in DisplayShelf causing half the images to be skipped. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/joglutils/trunk@53 83d24430-9974-4f80-8418-2cc3294053b9 --- src/net/java/joglutils/msg/nodes/Texture2.java | 13 +++++++++++++ src/net/java/joglutils/msg/test/DisplayShelfRenderer.java | 2 -- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/java/joglutils/msg/nodes/Texture2.java b/src/net/java/joglutils/msg/nodes/Texture2.java index 122de74..02763fc 100644 --- a/src/net/java/joglutils/msg/nodes/Texture2.java +++ b/src/net/java/joglutils/msg/nodes/Texture2.java @@ -252,6 +252,19 @@ public class Texture2 extends Node { } } + /** Disposes of the OpenGL texture and/or TextureRenderer this + Texture2 node refers to. An OpenGL context must be current at + the point this method is called. */ + public void dispose() throws GLException { + disposeTexture(); + disposeTextureRenderer(); + lazyDispose(); + data = null; + subImageData = null; + dirty = false; + subImageDirty = false; + } + private synchronized void disposeTextureRenderer() { if (textureRenderer != null) { disposedRenderers.add(textureRenderer); diff --git a/src/net/java/joglutils/msg/test/DisplayShelfRenderer.java b/src/net/java/joglutils/msg/test/DisplayShelfRenderer.java index e9eb1ea..adf1263 100644 --- a/src/net/java/joglutils/msg/test/DisplayShelfRenderer.java +++ b/src/net/java/joglutils/msg/test/DisplayShelfRenderer.java @@ -296,8 +296,6 @@ public class DisplayShelfRenderer implements GLEventListener { // Add this to each rendering root imageRoot.addChild(sep); mirrorRoot.addChild(sep); - - ++i; } // Now produce the floor geometry -- cgit v1.2.3