summaryrefslogtreecommitdiffstats
path: root/src/net/java/games/jogl/GLCanvas.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/games/jogl/GLCanvas.java')
-rw-r--r--src/net/java/games/jogl/GLCanvas.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/net/java/games/jogl/GLCanvas.java b/src/net/java/games/jogl/GLCanvas.java
index 527289fdc..9d58930e4 100644
--- a/src/net/java/games/jogl/GLCanvas.java
+++ b/src/net/java/games/jogl/GLCanvas.java
@@ -160,6 +160,18 @@ public final class GLCanvas extends Canvas implements GLDrawable {
return context.getNoAutoRedrawMode();
}
+ public void setAutoSwapBufferMode(boolean onOrOff) {
+ context.setAutoSwapBufferMode(onOrOff);
+ }
+
+ public boolean getAutoSwapBufferMode() {
+ return context.getAutoSwapBufferMode();
+ }
+
+ public void swapBuffers() {
+ context.invokeGL(swapBuffersAction, false, initAction);
+ }
+
public boolean canCreateOffscreenDrawable() {
return context.canCreatePbufferContext();
}
@@ -195,4 +207,11 @@ public final class GLCanvas extends Canvas implements GLDrawable {
}
}
private DisplayAction displayAction = new DisplayAction();
+
+ class SwapBuffersAction implements Runnable {
+ public void run() {
+ context.swapBuffers();
+ }
+ }
+ private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
}