aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2008-08-09 02:07:36 +0000
committerKenneth Russel <[email protected]>2008-08-09 02:07:36 +0000
commit2360494f69b0b624b12ac8dbd838d79b214ebf6f (patch)
tree0ececceae42152e17769a10bf3623405bf9baf98
parent16b35828d26acd9076fb7addd6382a66e5e57e6c (diff)
Fixed problem with Newt GLWindow where the EGL implementation we're
working with expects the context to be current while swapping the buffers git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1745 232f8b59-042b-4e1e-8c03-345bb8c30851
-rw-r--r--src/classes/com/sun/javafx/newt/GLWindow.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/classes/com/sun/javafx/newt/GLWindow.java b/src/classes/com/sun/javafx/newt/GLWindow.java
index de2205773..e46416a1d 100644
--- a/src/classes/com/sun/javafx/newt/GLWindow.java
+++ b/src/classes/com/sun/javafx/newt/GLWindow.java
@@ -354,7 +354,12 @@ public class GLWindow extends Window implements GLAutoDrawable {
}
public void swapBuffers() {
- drawable.swapBuffers();
+ if (context != null && context != GLContext.getCurrent()) {
+ // Assume we should try to make the context current before swapping the buffers
+ helper.invokeGL(drawable, context, swapBuffersAction, initAction);
+ } else {
+ drawable.swapBuffers();
+ }
}
class InitAction implements Runnable {
@@ -380,6 +385,14 @@ public class GLWindow extends Window implements GLAutoDrawable {
private DisplayAction displayAction = new DisplayAction();
+ class SwapBuffersAction implements Runnable {
+ public void run() {
+ drawable.swapBuffers();
+ }
+ }
+
+ private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
+
//----------------------------------------------------------------------
// GLDrawable methods that are not really needed
//