aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/games/jogl/impl')
-rw-r--r--src/net/java/games/jogl/impl/macosx/MacOSXGLContext.java2
-rw-r--r--src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java21
2 files changed, 21 insertions, 2 deletions
diff --git a/src/net/java/games/jogl/impl/macosx/MacOSXGLContext.java b/src/net/java/games/jogl/impl/macosx/MacOSXGLContext.java
index e6169a4b9..e1618a15a 100644
--- a/src/net/java/games/jogl/impl/macosx/MacOSXGLContext.java
+++ b/src/net/java/games/jogl/impl/macosx/MacOSXGLContext.java
@@ -108,7 +108,7 @@ public abstract class MacOSXGLContext extends GLContext
if (nsContext == 0) {
throw new GLException("Error creating nsContext");
}
- updater = CGL.updateContextRegister(nsContext, nsView);
+ //updater = CGL.updateContextRegister(nsContext, nsView); // gznote: not thread safe yet!
GLContextShareSet.contextCreated(this);
}
diff --git a/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java b/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
index ec46de0d8..97020de28 100644
--- a/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
+++ b/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
@@ -50,6 +50,7 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext {
private JAWT_DrawingSurface ds;
private JAWT_DrawingSurfaceInfo dsi;
private JAWT_MacOSXDrawingSurfaceInfo macosxdsi;
+ private Runnable myDeferredReshapeAction;
// Variables for pbuffer support
List pbuffersToInstantiate = new ArrayList();
@@ -61,6 +62,24 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext {
super(component, capabilities, chooser, shareWith);
}
+ // gznote: remove when updater is thread safe!
+ public synchronized void invokeGL(final Runnable runnable, boolean isReshape, Runnable initAction) throws GLException {
+ if (isReshape) {
+ myDeferredReshapeAction = new Runnable() {
+ public void run() {
+ CGL.updateContext(nsContext, nsView);
+ runnable.run();
+ }
+ };
+ } else {
+ if (myDeferredReshapeAction != null) {
+ super.invokeGL(myDeferredReshapeAction, true, initAction);
+ myDeferredReshapeAction = null;
+ }
+ super.invokeGL(runnable, isReshape, initAction);
+ }
+ }
+
protected GL createGL() {
return new MacOSXGLImpl(this);
}
@@ -167,7 +186,7 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext {
// OpenGL nsContext so it will be recreated
if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
if (nsContext != 0) {
- CGL.updateContextUnregister(nsContext, nsView, updater);
+ //CGL.updateContextUnregister(nsContext, nsView, updater); // gznote: not thread safe yet!
if (!CGL.deleteContext(nsContext, nsView)) {
throw new GLException("Unable to delete old GL nsContext after surface changed");
}