From 6ab634654f58afcf4549fcd1a796a0f9fd13298c Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 27 Aug 2015 14:01:10 +0200 Subject: Bug 1202 - Move GLContextImpl.*SwapInterval* into its own section --- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 60 ++++++++++++----------- 1 file changed, 32 insertions(+), 28 deletions(-) (limited to 'src/jogl') diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 39c5796f3..4ec9a5f21 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1113,34 +1113,6 @@ public abstract class GLContextImpl extends GLContext { } } - @Override - public final boolean setSwapInterval(final int interval) throws GLException { - validateCurrent(); - return setSwapIntervalNC(interval); - } - protected final boolean setSwapIntervalNC(final int interval) throws GLException { - if( drawable.getChosenGLCapabilities().isOnscreen() && - ( !drawableRetargeted || !hasRendererQuirk(GLRendererQuirks.NoSetSwapIntervalPostRetarget) ) - ) - { - final Integer usedInterval = setSwapIntervalImpl(interval); - if( null != usedInterval ) { - currentSwapInterval = usedInterval.intValue(); - return true; - } - } - return false; - } - protected abstract Integer setSwapIntervalImpl(final int interval); - - public final int getSwapInterval() { - return currentSwapInterval; - } - protected final void setDefaultSwapInterval() { - currentSwapInterval = 0; - setSwapIntervalNC(1); - } - /** * Note: Since context creation is temporary, caller need to issue {@link #resetStates(boolean)}, if creation was successful, i.e. returns true. * This method does not reset the states, allowing the caller to utilize the state variables. @@ -2394,6 +2366,38 @@ public abstract class GLContextImpl extends GLContext { } } + //---------------------------------------------------------------------- + // SwapBuffer + + @Override + public final boolean setSwapInterval(final int interval) throws GLException { + validateCurrent(); + return setSwapIntervalNC(interval); + } + protected final boolean setSwapIntervalNC(final int interval) throws GLException { + if( drawable.getChosenGLCapabilities().isOnscreen() && + ( !drawableRetargeted || !hasRendererQuirk(GLRendererQuirks.NoSetSwapIntervalPostRetarget) ) + ) + { + final Integer usedInterval = setSwapIntervalImpl(interval); + if( null != usedInterval ) { + currentSwapInterval = usedInterval.intValue(); + return true; + } + } + return false; + } + protected abstract Integer setSwapIntervalImpl(final int interval); + + public final int getSwapInterval() { + return currentSwapInterval; + } + protected final void setDefaultSwapInterval() { + currentSwapInterval = 0; + setSwapIntervalNC(1); + } + + //---------------------------------------------------------------------- // Helpers for buffer object optimizations -- cgit v1.2.3