From 554aeda4c46ee889e7ccb2cf1f988328b856bad1 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Thu, 15 Jul 2004 21:42:04 +0000 Subject: 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 --- src/net/java/games/jogl/impl/x11/X11GLContext.java | 4 +--- .../games/jogl/impl/x11/X11OffscreenGLContext.java | 21 ++++++++++++--------- 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); + } } } -- cgit v1.2.3