summaryrefslogtreecommitdiffstats
path: root/src/demos/es2/RedSquare.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/es2/RedSquare.java')
-rwxr-xr-xsrc/demos/es2/RedSquare.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/demos/es2/RedSquare.java b/src/demos/es2/RedSquare.java
index de7563e..b224233 100755
--- a/src/demos/es2/RedSquare.java
+++ b/src/demos/es2/RedSquare.java
@@ -80,7 +80,7 @@ public class RedSquare implements MouseListener, GLEventListener {
}
// Shut things down cooperatively
- window.close();
+ window.destroy();
window.getFactory().shutdown();
System.out.println("RedSquare shut down cleanly.");
} catch (Throwable t) {
@@ -189,6 +189,16 @@ public class RedSquare implements MouseListener, GLEventListener {
st.glUseProgram(gl, false);
}
+ public void dispose(GLAutoDrawable drawable) {
+ GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+ st.destroy(gl);
+ st=null;
+ pmvMatrix.destroy();
+ pmvMatrix=null;
+ quit=true;
+ }
+
public void display(GLAutoDrawable drawable) {
GL2ES2 gl = drawable.getGL().getGL2ES2();