diff options
author | Kenneth Russel <[email protected]> | 2005-09-09 07:08:45 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-09-09 07:08:45 +0000 |
commit | ffb098e3eed864346f1bd9f53021b17f9148da49 (patch) | |
tree | c95f36b4e25fb8facace3e8ead0827e61a80093e /src/demos/vertexArrayRange | |
parent | 6988570ed0a3ffa8f6d544cdb245cb7f0e77885c (diff) |
Refactored demos to mostly subclass common Demo superclass providing
shutdown capabilities. Moved DemoListener to demos.common package.
Added ManipManager removal code to demos using manipulators or
ExaminerViewer to fix memory leak when run in JRefract harness. Added
workaround for another seeming memory leak when run under current JDK
1.6 due to java.awt.Component now being finalizable and keeping data
alive longer than previously. Made ManipManager.unregisterWindow more
lenient with respect to null or invalid arguments.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/branches/JSR-231@122 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src/demos/vertexArrayRange')
-rw-r--r-- | src/demos/vertexArrayRange/VertexArrayRange.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/demos/vertexArrayRange/VertexArrayRange.java b/src/demos/vertexArrayRange/VertexArrayRange.java index 26d5512..7c4d1a5 100644 --- a/src/demos/vertexArrayRange/VertexArrayRange.java +++ b/src/demos/vertexArrayRange/VertexArrayRange.java @@ -42,6 +42,7 @@ import javax.swing.*; import javax.media.opengl.*; import com.sun.opengl.utils.*; import com.sun.opengl.utils.*; +import demos.common.*; import demos.util.*; /** <P> A port of NVidia's [tm] Vertex Array Range demonstration to @@ -75,7 +76,7 @@ import demos.util.*; C++ speed with the HotSpot Client and Server compilers, respectively. </P> */ -public class VertexArrayRange implements GLEventListener { +public class VertexArrayRange extends Demo { public static void main(String[] args) { boolean startSlow = false; @@ -135,15 +136,10 @@ public class VertexArrayRange implements GLEventListener { setFlag('v', true); // VAR on } - public void setDemoListener(DemoListener listener) { - demoListener = listener; - } - //---------------------------------------------------------------------- // Internals only below this point // - private DemoListener demoListener; private boolean[] b = new boolean[256]; private static final int SIZEOF_FLOAT = 4; private static final int STRIP_SIZE = 48; @@ -264,7 +260,7 @@ public class VertexArrayRange implements GLEventListener { new Thread(new Runnable() { public void run() { JOptionPane.showMessageDialog(null, message, "Unavailable extension", JOptionPane.ERROR_MESSAGE); - demoListener.shutdownDemo(); + shutdownDemo(); } }).start(); throw new RuntimeException(message); @@ -289,7 +285,7 @@ public class VertexArrayRange implements GLEventListener { ensurePresent(gl, "glFinishFenceNV"); ensurePresent(gl, "glAllocateMemoryNV"); } catch (RuntimeException e) { - demoListener.shutdownDemo(); + shutdownDemo(); throw (e); } @@ -371,7 +367,7 @@ public class VertexArrayRange implements GLEventListener { setFlag(k, !getFlag(k)); // Quit on escape or 'q' if ((k == (char) 27) || (k == 'q')) { - demoListener.shutdownDemo(); + shutdownDemo(); return; } |