summaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2004-07-15 21:42:04 +0000
committerKenneth Russel <[email protected]>2004-07-15 21:42:04 +0000
commit554aeda4c46ee889e7ccb2cf1f988328b856bad1 (patch)
tree77fc602080c7fb786834399fc39cbef20e835623 /src/net/java/games/jogl
parent115b1d63d1e541b6ac3a4319c06cdc28f64c1975 (diff)
Fixed build problems on Linux after bug fixes to context destruction
and recreation git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@137 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl')
-rw-r--r--src/net/java/games/jogl/impl/x11/X11GLContext.java4
-rw-r--r--src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java21
2 files changed, 13 insertions, 12 deletions
diff --git a/src/net/java/games/jogl/impl/x11/X11GLContext.java b/src/net/java/games/jogl/impl/x11/X11GLContext.java
index 40e462fb3..359d0c95c 100644
--- a/src/net/java/games/jogl/impl/x11/X11GLContext.java
+++ b/src/net/java/games/jogl/impl/x11/X11GLContext.java
@@ -174,9 +174,7 @@ public abstract class X11GLContext extends GLContext {
protected void destroyImpl() throws GLException {
if (context != 0) {
- if (!GLX.glXDestroyContext(mostRecentDisplay, context)) {
- throw new GLException("Unable to delete OpenGL context");
- }
+ GLX.glXDestroyContext(mostRecentDisplay, context);
if (DEBUG) {
System.err.println("!!! Destroyed OpenGL context " + context);
}
diff --git a/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java b/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java
index 0290f8d44..2aa85e9f8 100644
--- a/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java
+++ b/src/net/java/games/jogl/impl/x11/X11OffscreenGLContext.java
@@ -167,14 +167,17 @@ public class X11OffscreenGLContext extends X11GLContext {
isDoubleBuffered = (X11GLContextFactory.glXGetConfig(display, vis, GLX.GLX_DOUBLEBUFFER, new int[1]) != 0);
}
- private void destroy() {
- // Must destroy OpenGL context, pixmap and GLXPixmap
- GLX.glXDestroyContext(display, context);
- GLX.glXDestroyGLXPixmap(display, (int) drawable);
- GLX.XFreePixmap(display, pixmap);
- context = 0;
- drawable = 0;
- pixmap = 0;
- GLContextShareSet.contextDestroyed(this);
+ protected void destroyImpl() {
+ if (context != 0) {
+ super.destroyImpl();
+ // Must destroy OpenGL context, pixmap and GLXPixmap
+ GLX.glXDestroyContext(display, context);
+ GLX.glXDestroyGLXPixmap(display, (int) drawable);
+ GLX.XFreePixmap(display, pixmap);
+ context = 0;
+ drawable = 0;
+ pixmap = 0;
+ GLContextShareSet.contextDestroyed(this);
+ }
}
}