aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2004-07-09 23:03:24 +0000
committerKenneth Russel <[email protected]>2004-07-09 23:03:24 +0000
commit115b1d63d1e541b6ac3a4319c06cdc28f64c1975 (patch)
tree0d83bc241678a15627add9780e6a0df1d09d0fac /src
parentdb4a342a3b192f5fcf7dfc69d698e63c91a75441 (diff)
Bug fix to new context destruction / recreation code associated with
recent checkin for following issues: Issue 59: GLContext Leak Issue 67: Java/Jogl app hangs some systems, not others, during reshape. Issue 69: Error on window resize Issue 89: Losing Backbuffer when Resizing/Moving a window git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@136 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r--src/net/java/games/jogl/impl/windows/WindowsOffscreenGLContext.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/net/java/games/jogl/impl/windows/WindowsOffscreenGLContext.java b/src/net/java/games/jogl/impl/windows/WindowsOffscreenGLContext.java
index 68a5655da..9e871caba 100644
--- a/src/net/java/games/jogl/impl/windows/WindowsOffscreenGLContext.java
+++ b/src/net/java/games/jogl/impl/windows/WindowsOffscreenGLContext.java
@@ -118,7 +118,7 @@ public class WindowsOffscreenGLContext extends WindowsGLContext {
if (pendingOffscreenResize) {
if (pendingOffscreenWidth != width || pendingOffscreenHeight != height) {
if (hglrc != 0) {
- destroy();
+ destroyImpl();
}
width = pendingOffscreenWidth;
height = pendingOffscreenHeight;
@@ -128,6 +128,19 @@ public class WindowsOffscreenGLContext extends WindowsGLContext {
return super.makeCurrent(initAction);
}
+ protected void destroyImpl() {
+ if (hglrc != 0) {
+ super.destroyImpl();
+ // Must destroy OpenGL context, bitmap and device context
+ WGL.SelectObject(hdc, origbitmap);
+ WGL.DeleteObject(hbitmap);
+ WGL.DeleteDC(hdc);
+ origbitmap = 0;
+ hbitmap = 0;
+ hdc = 0;
+ }
+ }
+
public synchronized void swapBuffers() throws GLException {
}
@@ -167,17 +180,4 @@ public class WindowsOffscreenGLContext extends WindowsGLContext {
choosePixelFormatAndCreateContext(false);
}
-
- private void destroy() {
- // Must destroy OpenGL context, bitmap and device context
- WGL.wglDeleteContext(hglrc);
- WGL.SelectObject(hdc, origbitmap);
- WGL.DeleteObject(hbitmap);
- WGL.DeleteDC(hdc);
- hglrc = 0;
- origbitmap = 0;
- hbitmap = 0;
- hdc = 0;
- GLContextShareSet.contextDestroyed(this);
- }
}