diff options
author | Kenneth Russel <[email protected]> | 2004-04-09 23:17:13 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2004-04-09 23:17:13 +0000 |
commit | 4490939da088ce982df0a8cc2b31a806e066a24d (patch) | |
tree | ec9ba36b4118f0b7a1fa22f202cedeff26ae18d7 /src | |
parent | f90ab644c419486f7894fda3725a9c81de8bb283 (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')
-rw-r--r-- | src/net/java/games/jogl/GLJPanel.java | 19 | ||||
-rw-r--r-- | src/net/java/games/jogl/impl/GLPbufferImpl.java | 19 |
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(); } |