From 9a4619d5ab1c0441dfb273d057e288b4bf4c6dbc Mon Sep 17 00:00:00 2001 From: sg215889 Date: Thu, 30 Jul 2009 22:09:24 -0700 Subject: Fix SwapInterval (return value, check ctx current, egl), add getSwapInterval. --- src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/jogl/classes/com/sun/opengl/impl/x11') diff --git a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java index 57abcf588..718d55aa0 100644 --- a/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java +++ b/src/jogl/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java @@ -396,11 +396,9 @@ public abstract class X11GLXContext extends GLContextImpl { private int hasSwapIntervalSGI = 0; - public void setSwapInterval(int interval) { + protected void setSwapIntervalImpl(int interval) { getDrawableImpl().getFactoryImpl().lockToolkit(); try { - // FIXME: make the context current first? Currently assumes that - // will not be necessary. Make the caller do this? GLXExt glXExt = getGLXExt(); if(0==hasSwapIntervalSGI) { try { @@ -409,7 +407,9 @@ public abstract class X11GLXContext extends GLContextImpl { } if (hasSwapIntervalSGI>0) { try { - glXExt.glXSwapIntervalSGI(interval); + if( 0 == glXExt.glXSwapIntervalSGI(interval) ) { + currentSwapInterval = interval; + } } catch (Throwable t) { hasSwapIntervalSGI=-1; } } } finally { -- cgit v1.2.3