diff options
Diffstat (limited to 'src/demos/es1/cubefbo')
-rwxr-xr-x | src/demos/es1/cubefbo/FBCubes.java | 13 | ||||
-rwxr-xr-x | src/demos/es1/cubefbo/Main.java | 12 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/demos/es1/cubefbo/FBCubes.java b/src/demos/es1/cubefbo/FBCubes.java index f5f98f1..624bbc2 100755 --- a/src/demos/es1/cubefbo/FBCubes.java +++ b/src/demos/es1/cubefbo/FBCubes.java @@ -59,6 +59,8 @@ class FBCubes implements GLEventListener { GLFixedFuncIf gl; { GL _gl = drawable.getGL(); + // drawable.setGL(new DebugGL2(_gl.getGL2())); + // _gl = drawable.getGL(); if(!GLFixedFuncUtil.isGLFixedFuncIf(_gl)) { if(_gl.isGLES2()) { gl = new GLFixedFuncImpl(_gl, new FixedFuncHook(_gl.getGL2ES2())); @@ -70,6 +72,7 @@ class FBCubes implements GLEventListener { gl = GLFixedFuncUtil.getGLFixedFuncIf(_gl); } } + System.out.println(gl); gl.glGetError(); // flush error .. @@ -110,6 +113,16 @@ class FBCubes implements GLEventListener { this.yRot = yRot; } + public void dispose(GLAutoDrawable drawable) { + GLFixedFuncIf gl = GLFixedFuncUtil.getGLFixedFuncIf(drawable.getGL()); + fbo1.destroy(gl); + fbo1=null; + cubeInner.dispose(drawable); + cubeInner=null; + cubeOuter.dispose(drawable); + cubeOuter=null; + } + public void display(GLAutoDrawable drawable) { GLFixedFuncIf gl = GLFixedFuncUtil.getGLFixedFuncIf(drawable.getGL()); diff --git a/src/demos/es1/cubefbo/Main.java b/src/demos/es1/cubefbo/Main.java index f245733..9d3df4e 100755 --- a/src/demos/es1/cubefbo/Main.java +++ b/src/demos/es1/cubefbo/Main.java @@ -5,12 +5,19 @@ import javax.media.nwi.*; import javax.media.opengl.*; import com.sun.javafx.newt.*; -public class Main implements MouseListener { +public class Main implements WindowListener, MouseListener { public boolean quit = false; public GLWindow window = null; + public void windowResized(WindowEvent e) { } + public void windowMoved(WindowEvent e) { } + public void windowDestroyNotify(WindowEvent e) { + quit = true; + } + public void mouseClicked(MouseEvent e) { + System.out.println("mouseevent: "+e); switch(e.getClickCount()) { case 1: if(null!=window) { @@ -57,6 +64,7 @@ public class Main implements MouseListener { } window = GLWindow.create(nWindow, caps); + window.addWindowListener(this); window.addMouseListener(this); window.enablePerfLog(true); @@ -73,7 +81,7 @@ public class Main implements MouseListener { } // Shut things down cooperatively - window.close(); + window.destroy(); window.getFactory().shutdown(); System.out.println("cubefbo.Main shut down cleanly."); } catch (GLException e) { |