aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
diff options
context:
space:
mode:
authorsg215889 <[email protected]>2009-07-30 22:09:24 -0700
committersg215889 <[email protected]>2009-07-30 22:09:24 -0700
commit9a4619d5ab1c0441dfb273d057e288b4bf4c6dbc (patch)
tree32a937f2eefbf31f6785b9e2bea805cb0f86cb6c /src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
parentcd0ec06b5e8a5ec39c8162e87d23c935b506021e (diff)
Fix SwapInterval (return value, check ctx current, egl), add getSwapInterval.
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java')
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
index c60cccec6..fa7e1ade7 100644
--- a/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/jogl/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -284,11 +284,23 @@ public abstract class GLContextImpl extends GLContext {
public abstract ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3);
- /*
- * Sets the swap interval for onscreen OpenGL contexts. Has no
- * effect for offscreen contexts.
- */
public void setSwapInterval(final int interval) {
+ GLContext current = getCurrent();
+ if (current != this) {
+ throw new GLException("This context is not current. Current context: "+current+
+ ", this context "+this);
+ }
+ setSwapIntervalImpl(interval);
+ }
+
+ protected int currentSwapInterval = -1; // default: not set yet ..
+
+ public int getSwapInterval() {
+ return currentSwapInterval;
+ }
+
+ protected void setSwapIntervalImpl(final int interval) {
+ // nop per default ..
}
/** Maps the given "platform-independent" function name to a real function