aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
diff options
context:
space:
mode:
authorKenneth Russel <kbrussel@alum.mit.edu>2005-04-24 22:59:51 +0000
committerKenneth Russel <kbrussel@alum.mit.edu>2005-04-24 22:59:51 +0000
commit492f117fd3f76c7a5778ca2a07c6f5803242b8e0 (patch)
treebebfe51a2cb8fc36613cdd8ad6caf04b88d1ef47 /src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
parentc35019b5256ca33fb642d54608101ab7292f3c60 (diff)
Merged with current JOGL trunk (by using -r HEAD)
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@262 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java')
-rw-r--r--src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java b/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
index e957092ee..401a657fe 100644
--- a/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
+++ b/src/net/java/games/jogl/impl/macosx/MacOSXOnscreenGLContext.java
@@ -52,7 +52,6 @@ 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();
@@ -67,24 +66,6 @@ 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 boolean isOffscreen() {
return false;
}
@@ -136,6 +117,14 @@ public class MacOSXOnscreenGLContext extends MacOSXGLContext {
}
boolean ret = super.makeCurrent(initAction);
if (ret) {
+ // Assume the canvas might have been resized or moved and tell the OpenGL
+ // context to update itself. This used to be done only upon receiving a
+ // reshape event but that doesn't appear to be sufficient. An experiment
+ // was also done to add a HierarchyBoundsListener to the GLCanvas and
+ // do this updating only upon reshape of this component or reshape or movement
+ // of an ancestor, but this also wasn't sufficient and left garbage on the
+ // screen in some situations.
+ CGL.updateContext(nsContext, nsView);
// Instantiate any pending pbuffers
while (!pbuffersToInstantiate.isEmpty()) {
MacOSXPbufferGLContext ctx =