aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextImpl.java6
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java7
2 files changed, 13 insertions, 0 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java
index 8e38ec276..8963b2f5e 100644
--- a/src/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -97,6 +97,8 @@ public abstract class GLContextImpl extends GLContext {
if (current != null) {
if (current == this) {
// Assume we don't need to make this context current again
+ // For Mac OS X, however, we need to update the context to track resizes
+ update();
return CONTEXT_CURRENT;
} else {
current.release();
@@ -184,6 +186,10 @@ public abstract class GLContextImpl extends GLContext {
protected abstract void destroyImpl() throws GLException;
+ // This is only needed for Mac OS X on-screen contexts
+ protected void update() throws GLException {
+ }
+
public boolean isSynchronized() {
return !lock.getFailFastMode();
}
diff --git a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java
index dedc5a0ee..e011d271b 100644
--- a/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java
+++ b/src/classes/com/sun/opengl/impl/macosx/MacOSXOnscreenGLContext.java
@@ -88,4 +88,11 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext {
throw new GLException("Error swapping buffers");
}
}
+
+ protected void update() throws GLException {
+ if (nsContext == 0) {
+ throw new GLException("Context not created");
+ }
+ CGL.updateContext(nsContext);
+ }
}