diff options
-rwxr-xr-x | src/classes/com/sun/opengl/impl/egl/EGLDrawable.java | 5 | ||||
-rw-r--r-- | src/classes/javax/media/opengl/GLDrawable.java | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java index 22b39e291..8ac790157 100755 --- a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java @@ -88,7 +88,8 @@ public class EGLDrawable implements GLDrawable { return display; } - public void shutdown() { + public void destroy() { + setRealized(false); EGL.eglTerminate(display); } @@ -111,7 +112,7 @@ public class EGLDrawable implements GLDrawable { if (surface == EGL.EGL_NO_SURFACE) { throw new GLException("Creation of window surface (eglCreateWindowSurface) failed"); } - } else { + } else if( surface != EGL.EGL_NO_SURFACE ) { // Destroy the window surface // FIXME: we should expose a destroy() method on // GLDrawable and get rid of setRealized(), instead diff --git a/src/classes/javax/media/opengl/GLDrawable.java b/src/classes/javax/media/opengl/GLDrawable.java index 6c0178474..d57ddc0ee 100644 --- a/src/classes/javax/media/opengl/GLDrawable.java +++ b/src/classes/javax/media/opengl/GLDrawable.java @@ -103,6 +103,13 @@ public interface GLDrawable { */ public void setRealized(boolean realized); + /** + * Cleanup the complete association to the native Canvas's display, + * and releases all ressources. + * This implies a call to <code>setRealized(false)</code> + */ + public void destroy(); + /** Requests a new width and height for this GLDrawable. Not all drawables are able to respond to this request and may silently ignore it. */ |