diff options
author | Kenneth Russel <[email protected]> | 2008-05-30 08:40:44 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2008-05-30 08:40:44 +0000 |
commit | 1ff64b2c2aa841964343b21aff2927abc510f093 (patch) | |
tree | 6adf52f31391643173b2f167bbcec83b72f36a54 /src/classes/com/sun/opengl/impl/egl | |
parent | b5aed7df3ac9ebd87498247882d0c874891c0ce9 (diff) |
Added GLDrawableFactory.shutdown() to enable clean and cooperative
termination, overriding it in EGLDrawableFactory to call eglTerminate.
Made EGLDrawable.setRealized(false) clean up the EGLSurface.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1650 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/impl/egl')
-rwxr-xr-x | src/classes/com/sun/opengl/impl/egl/EGLDrawable.java | 10 | ||||
-rwxr-xr-x | src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java index 49dea75ce..abdbd2b7f 100755 --- a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java +++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java @@ -95,6 +95,16 @@ public class EGLDrawable implements GLDrawable { if (surface == EGL.EGL_NO_SURFACE) { throw new GLException("Creation of window surface (eglCreateWindowSurface) failed"); } + } else { + // Destroy the window surface + // FIXME: we should expose a destroy() method on + // GLDrawable and get rid of setRealized(), instead + // destroying and re-creating the GLDrawable associated + // with for example a GLCanvas each time + if (!EGL.eglDestroySurface(display, surface)) { + throw new GLException("Error destroying window surface (eglDestroySurface)"); + } + surface = EGL.EGL_NO_SURFACE; } } diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java index 2a8b8fbae..b66d1d33e 100755 --- a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java +++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java @@ -113,6 +113,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { glesLibraries = libs; } + public void shutdown() { + EGL.eglTerminate(display); + } + public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities, GLCapabilitiesChooser chooser, AbstractGraphicsDevice device) { |