summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-09-09 15:43:51 +0200
committerSven Gothel <[email protected]>2011-09-09 15:43:51 +0200
commit8def3e243401a0fe8ce606de6a54381a65626f15 (patch)
treef41e107ade84b5eedcd64063b997f791073d4117 /src/jogl/classes/javax/media/opengl
parent2083ba25be5ce9b55cc2f5a420f17c3bb5ff1750 (diff)
*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
Diffstat (limited to 'src/jogl/classes/javax/media/opengl')
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java42
1 files changed, 42 insertions, 0 deletions
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 <i>GL_ARB_debug_output</i> or <i>GL_AMD_debug_output</i>.