summaryrefslogtreecommitdiffstats
path: root/src/demos/vertexBufferObject/VertexBufferObject.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-09-09 07:08:45 +0000
committerKenneth Russel <[email protected]>2005-09-09 07:08:45 +0000
commitffb098e3eed864346f1bd9f53021b17f9148da49 (patch)
treec95f36b4e25fb8facace3e8ead0827e61a80093e /src/demos/vertexBufferObject/VertexBufferObject.java
parent6988570ed0a3ffa8f6d544cdb245cb7f0e77885c (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/vertexBufferObject/VertexBufferObject.java')
-rw-r--r--src/demos/vertexBufferObject/VertexBufferObject.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/demos/vertexBufferObject/VertexBufferObject.java b/src/demos/vertexBufferObject/VertexBufferObject.java
index ee78499..97a5483 100644
--- a/src/demos/vertexBufferObject/VertexBufferObject.java
+++ b/src/demos/vertexBufferObject/VertexBufferObject.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
@@ -67,7 +68,7 @@ import demos.util.*;
same data in system memory allows. </P>
*/
-public class VertexBufferObject implements GLEventListener {
+public class VertexBufferObject extends Demo {
public static void main(String[] args) {
boolean vboEnabled = true;
@@ -124,15 +125,10 @@ public class VertexBufferObject implements GLEventListener {
setFlag('i', true); // infinite viewer and light
}
- public void setDemoListener(DemoListener listener) {
- demoListener = listener;
- }
-
//----------------------------------------------------------------------
// Internals only below this point
//
- private DemoListener demoListener;
private boolean initComplete;
private boolean[] b = new boolean[256];
private static final int SIZEOF_FLOAT = 4;
@@ -266,7 +262,7 @@ public class VertexBufferObject 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);
@@ -366,7 +362,7 @@ public class VertexBufferObject implements GLEventListener {
setFlag(k, !getFlag(k));
// Quit on escape or 'q'
if ((k == (char) 27) || (k == 'q')) {
- demoListener.shutdownDemo();
+ shutdownDemo();
return;
}