diff options
author | Sven Gothel <[email protected]> | 2011-09-09 15:43:51 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-09 15:43:51 +0200 |
commit | 8def3e243401a0fe8ce606de6a54381a65626f15 (patch) | |
tree | f41e107ade84b5eedcd64063b997f791073d4117 /src/jogl/classes/jogamp/opengl/GLContextImpl.java | |
parent | 2083ba25be5ce9b55cc2f5a420f17c3bb5ff1750 (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/jogamp/opengl/GLContextImpl.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index cf4a71a8a..c3fcc5057 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -126,6 +126,7 @@ public abstract class GLContextImpl extends GLContext { this.glDebugHandler = new GLDebugMessageHandler(this); } + @Override protected void resetStates() { // Because we don't know how many other contexts we might be // sharing with (and it seems too complicated to implement the @@ -800,24 +801,10 @@ public abstract class GLContextImpl extends GLContext { public abstract ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3); - public final 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 void setSwapIntervalImpl(final int interval) { /** nop per default .. **/ } - protected int currentSwapInterval = -1; // default: not set yet .. - public int getSwapInterval() { - return currentSwapInterval; - } - /** Maps the given "platform-independent" function name to a real function name. Currently this is only used to map "glAllocateMemoryNV" and associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV. */ - protected String mapToRealGLFunctionName(String glFunctionName) { + protected final String mapToRealGLFunctionName(String glFunctionName) { Map<String, String> map = getFunctionNameMap(); String lookup = ( null != map ) ? map.get(glFunctionName) : null; if (lookup != null) { @@ -832,7 +819,7 @@ public abstract class GLContextImpl extends GLContext { "GL_ARB_pbuffer" to "WGL_ARB_pbuffer/GLX_SGIX_pbuffer" and "GL_ARB_pixel_format" to "WGL_ARB_pixel_format/n.a." */ - protected String mapToRealGLExtensionName(String glExtensionName) { + protected final String mapToRealGLExtensionName(String glExtensionName) { Map<String, String> map = getExtensionNameMap(); String lookup = ( null != map ) ? map.get(glExtensionName) : null; if (lookup != null) { @@ -844,7 +831,7 @@ public abstract class GLContextImpl extends GLContext { /** Helper routine which resets a ProcAddressTable generated by the GLEmitter by looking up anew all of its function pointers. */ - protected void resetProcAddressTable(ProcAddressTable table) { + protected final void resetProcAddressTable(ProcAddressTable table) { table.reset(getDrawableImpl().getGLDynamicLookupHelper() ); } @@ -957,6 +944,8 @@ public abstract class GLContextImpl extends GLContext { */ protected abstract void updateGLXProcAddressTable(); + protected abstract StringBuffer getPlatformExtensionsStringImpl(); + /** * Returns true if the specified OpenGL core- or extension-function can be * successfully called using this GL context given the current host (OpenGL @@ -968,7 +957,7 @@ public abstract class GLContextImpl extends GLContext { * "glPolygonOffsetEXT" or "glPolygonOffset" to check if the {@link * javax.media.opengl.GL#glPolygonOffset(float,float)} is available). */ - public boolean isFunctionAvailable(String glFunctionName) { + public final boolean isFunctionAvailable(String glFunctionName) { // Check GL 1st (cached) ProcAddressTable pTable = getGLProcAddressTable(); // null if ctx not created once if(null!=pTable) { @@ -1023,14 +1012,14 @@ public abstract class GLContextImpl extends GLContext { return false; } - public String getPlatformExtensionsString() { + public final String getPlatformExtensionsString() { if(null!=extensionAvailability) { return extensionAvailability.getPlatformExtensionsString(); } return null; } - public String getGLExtensionsString() { + public final String getGLExtensionsString() { if(null!=extensionAvailability) { return extensionAvailability.getGLExtensionsString(); } |