diff options
author | Kenneth Russel <[email protected]> | 2005-04-24 00:10:41 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-04-24 00:10:41 +0000 |
commit | bafff33544dae0f28a0a7141d2a4ee05295ea2ec (patch) | |
tree | 52ab68a2f188a8f207474ab3c80d2abeaa125bb0 /src/net/java/games/jogl/impl/x11 | |
parent | 95a1681443162db968c5430097780bfd0ade0a68 (diff) |
Fixed Issue 92: Platform Independent VSync functionality
Added GL.setSwapInterval() which delegates to appropriate
platform-dependent routines. Must be called only from within
GLEventListener callbacks.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@260 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/net/java/games/jogl/impl/x11')
-rw-r--r-- | src/net/java/games/jogl/impl/x11/X11OnscreenGLContext.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/net/java/games/jogl/impl/x11/X11OnscreenGLContext.java b/src/net/java/games/jogl/impl/x11/X11OnscreenGLContext.java index 1b5f54979..241a45dc9 100644 --- a/src/net/java/games/jogl/impl/x11/X11OnscreenGLContext.java +++ b/src/net/java/games/jogl/impl/x11/X11OnscreenGLContext.java @@ -103,6 +103,13 @@ public class X11OnscreenGLContext extends X11GLContext { throw new GLException("Should not call this"); } + public void setSwapInterval(int interval) { + GL gl = getGL(); + if (gl.isExtensionAvailable("GLX_SGI_swap_control")) { + gl.glXSwapIntervalSGI(interval); + } + } + protected synchronized boolean makeCurrent(Runnable initAction) throws GLException { try { if (!lockSurface()) { |