From 8def3e243401a0fe8ce606de6a54381a65626f15 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 9 Sep 2011 15:43:51 +0200 Subject: *GLContext: resetStates(); getPlatformExtensionsString(); GLX/WGL NV_swap_group support; setSwapInterval(); resetStates() - fixes a bug where X11GLXContext impl. resetState() !! - marked all with @Override tag - ensured super.resetStates() is called at end (oops) getPlatformExtensionsStringImpl()* - fixes a bug where X11GLXContext overrides GLContext cached GLX extension string query - marked 'final' in GLContext to avoid bugs - using abstract 'getPlatformExtensionsStringImpl()' called by ExtensionAvailabilityCache Add premiliry GLX/WGL NV_swap_group support - thought it might be a solution to sync swap of 2 windows - none of my drivers/platforms support it, event though extension is avail on Linux Promote setSwapInterval() (1 up) - bumped above API up to public GLContext - those extension should not spam the GL interfaces .. hmm --- src/jogl/classes/javax/media/opengl/GLContext.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'src/jogl/classes/javax/media') diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index 0727dad1b..47a453484 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -549,6 +549,48 @@ public abstract class GLContext { return isGL2ES2() ; } + public final void setSwapInterval(int interval) { + if (!isCurrent()) { + throw new GLException("This context is not current. Current context: "+getCurrent()+", this context "+this); + } + setSwapIntervalImpl(interval); + } + protected void setSwapIntervalImpl(int interval) { /** nop per default .. **/ } + protected int currentSwapInterval = -1; // default: not set yet .. + public int getSwapInterval() { + return currentSwapInterval; + } + + public final boolean queryMaxSwapGroups(int[] maxGroups, int maxGroups_offset, + int[] maxBarriers, int maxBarriers_offset) { + + if (!isCurrent()) { + throw new GLException("This context is not current. Current context: "+getCurrent()+", this context "+this); + } + return queryMaxSwapGroupsImpl(maxGroups, maxGroups_offset, maxBarriers, maxBarriers_offset); + } + protected boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset, + int[] maxBarriers, int maxBarriers_offset) { return false; } + public final boolean joinSwapGroup(int group) { + if (!isCurrent()) { + throw new GLException("This context is not current. Current context: "+getCurrent()+", this context "+this); + } + return joinSwapGroupImpl(group); + } + protected boolean joinSwapGroupImpl(int group) { /** nop per default .. **/ return false; } + protected int currentSwapGroup = -1; // default: not set yet .. + public int getSwapGroup() { + return currentSwapGroup; + } + public final boolean bindSwapBarrier(int group, int barrier) { + if (!isCurrent()) { + throw new GLException("This context is not current. Current context: "+getCurrent()+", this context "+this); + } + return bindSwapBarrierImpl(group, barrier); + } + protected boolean bindSwapBarrierImpl(int group, int barrier) { /** nop per default .. **/ return false; } + + /** * @return The extension implementing the GLDebugOutput feature, * either GL_ARB_debug_output or GL_AMD_debug_output. -- cgit v1.2.3