diff options
author | Sven Gothel <[email protected]> | 2009-03-14 05:20:29 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2009-03-14 05:20:29 +0000 |
commit | 9517d52c18bfa93d78e03f4c212757eda421afb6 (patch) | |
tree | 8c1bc95802461520f3477c3c224d285debff4e2c /src/classes/com/sun/opengl/util/texture | |
parent | 78ff34edd75db5cd7f3055466d992ca7be3a70a6 (diff) |
NEWT window closing:
- New WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY and
WindowListener.windowDestroyNotify() method.
- Removed windowClosed() method for JNI hook
- Added windowDestroyNotify() windowDestroyed(),
where windowDestroyNotify() shall be called by the native implementation
_before_ the window gets shutdown.
The Window.java then sends a WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY event,
and either Window.java or it's owner GLWindow.java issues the destroy()
procedure.
- Added GLEventListener.dispose(GLAutoDrawable),
to allow user application to release GL ressources.
Issued by GLWindow (-> see windowDestroyNotify())
- X11 impl intercepts WM_DELETE_WINDOW, using Atom,
MacosX impl already uses the _before_ method (VERIFY),
and Windows impl uses the WM_CLOSE event (VERIFY).
JOGL2 dispose/destroy ..
- Added GLEventListener.dispose() to GLCanvas and GLJpanel
- GL* toString() rearrangement, assumes it is issued by GLContext(),
which indeed is the core information node.
- Added proper destroy() methods and calls,
to achieve a proper resource release at destruction.
Instrumentizing almost all classes with a destroy() method,
so no release function lookup is necessary.
- misc changes ..
JOGL2 Demos
- Fixed in regards to the above changes
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1867 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/opengl/util/texture')
-rwxr-xr-x | src/classes/com/sun/opengl/util/texture/Texture.java | 13 | ||||
-rwxr-xr-x | src/classes/com/sun/opengl/util/texture/TextureData.java | 7 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/classes/com/sun/opengl/util/texture/Texture.java b/src/classes/com/sun/opengl/util/texture/Texture.java index 29f22e57a..e16b840fa 100755 --- a/src/classes/com/sun/opengl/util/texture/Texture.java +++ b/src/classes/com/sun/opengl/util/texture/Texture.java @@ -264,17 +264,28 @@ public class Texture { * * @throws GLException if no OpenGL context was current or if any * OpenGL-related errors occurred + * @deprecated use destroy(GL) */ public void dispose() throws GLException { - dispose(GLU.getCurrentGL()); + destroy(GLU.getCurrentGL()); } /** * Disposes the native resources used by this texture object. * * @throws GLException if any OpenGL-related errors occurred + * @deprecated use destroy(GL) */ public void dispose(GL gl) throws GLException { + destroy(gl); + } + + /** + * Destroys the native resources used by this texture object. + * + * @throws GLException if any OpenGL-related errors occurred + */ + public void destroy(GL gl) throws GLException { gl.glDeleteTextures(1, new int[] {texID}, 0); texID = 0; } diff --git a/src/classes/com/sun/opengl/util/texture/TextureData.java b/src/classes/com/sun/opengl/util/texture/TextureData.java index dcaee52f2..8dbd124af 100755 --- a/src/classes/com/sun/opengl/util/texture/TextureData.java +++ b/src/classes/com/sun/opengl/util/texture/TextureData.java @@ -310,6 +310,13 @@ public class TextureData { } } + /** Calls flush() + * @see #flush() + */ + public void destroy() { + flush(); + } + /** Defines a callback mechanism to allow the user to explicitly deallocate native resources (memory-mapped files, etc.) associated with a particular TextureData. */ |