summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorGerard Ziemski <[email protected]>2003-10-12 07:00:38 +0000
committerGerard Ziemski <[email protected]>2003-10-12 07:00:38 +0000
commitb76c821858e7ee132aa08cc8d9d61e82eb9aa53f (patch)
treee00235e882fa92d176a033eda406f3221deb7451 /src/net
parentfbdf8c337805b02385bf43b65aad93c20a2e3ad2 (diff)
Disabling the context updater for now - not thread safe yet.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@68 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net')
-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");
}