summaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2004-04-09 23:17:13 +0000
committerKenneth Russel <[email protected]>2004-04-09 23:17:13 +0000
commit4490939da088ce982df0a8cc2b31a806e066a24d (patch)
treeec9ba36b4118f0b7a1fa22f202cedeff26ae18d7 /src/net
parentf90ab644c419486f7894fda3725a9c81de8bb283 (diff)
Fixed build problem with fix for Issue 25: Expose swapBuffers(), please
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@95 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net')
-rw-r--r--src/net/java/games/jogl/GLJPanel.java19
-rw-r--r--src/net/java/games/jogl/impl/GLPbufferImpl.java19
2 files changed, 38 insertions, 0 deletions
diff --git a/src/net/java/games/jogl/GLJPanel.java b/src/net/java/games/jogl/GLJPanel.java
index b887d01c1..3ac5c984c 100644
--- a/src/net/java/games/jogl/GLJPanel.java
+++ b/src/net/java/games/jogl/GLJPanel.java
@@ -182,6 +182,18 @@ public final class GLJPanel extends JPanel implements GLDrawable {
return false;
}
+ 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() {
// For now let's say no; maybe we can reimplement this class in
// terms of pbuffers (though not all vendors support them, and
@@ -304,4 +316,11 @@ public final class GLJPanel extends JPanel implements GLDrawable {
}
}
private DisplayAction displayAction = new DisplayAction();
+
+ class SwapBuffersAction implements Runnable {
+ public void run() {
+ context.swapBuffers();
+ }
+ }
+ private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
}
diff --git a/src/net/java/games/jogl/impl/GLPbufferImpl.java b/src/net/java/games/jogl/impl/GLPbufferImpl.java
index 2e5f5589f..2fb927c92 100644
--- a/src/net/java/games/jogl/impl/GLPbufferImpl.java
+++ b/src/net/java/games/jogl/impl/GLPbufferImpl.java
@@ -126,6 +126,18 @@ public class GLPbufferImpl implements GLPbuffer {
return false;
}
+ 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 false;
}
@@ -202,4 +214,11 @@ public class GLPbufferImpl implements GLPbuffer {
}
}
private DisplayAction displayAction = new DisplayAction();
+
+ class SwapBuffersAction implements Runnable {
+ public void run() {
+ context.swapBuffers();
+ }
+ }
+ private SwapBuffersAction swapBuffersAction = new SwapBuffersAction();
}