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/jogamp/opengl/egl/EGLContext.java | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/egl') diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java index 4d39472a4..2deae65fb 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java @@ -42,13 +42,14 @@ import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver; import java.nio.*; import java.util.*; + import javax.media.nativewindow.AbstractGraphicsConfiguration; import javax.media.nativewindow.AbstractGraphicsDevice; public abstract class EGLContext extends GLContextImpl { private boolean eglQueryStringInitialized; private boolean eglQueryStringAvailable; - private EGLExt eglExt; + private EGLExt _eglExt; // Table that holds the addresses of the native C-language entry points for // EGL extension functions. private EGLExtProcAddressTable eglExtProcAddressTable; @@ -58,15 +59,23 @@ public abstract class EGLContext extends GLContextImpl { super(drawable, shareWith); } + @Override + protected void resetStates() { + eglQueryStringInitialized = false; + eglQueryStringAvailable = false; + // no inner state _eglExt = null; + super.resetStates(); + } + public Object getPlatformGLExtensions() { return getEGLExt(); } public EGLExt getEGLExt() { - if (eglExt == null) { - eglExt = new EGLExtImpl(this); + if (_eglExt == null) { + _eglExt = new EGLExtImpl(this); } - return eglExt; + return _eglExt; } public final ProcAddressTable getPlatformExtProcAddressTable() { @@ -237,22 +246,22 @@ public abstract class EGLContext extends GLContextImpl { } } - public synchronized String getPlatformExtensionsString() { + protected final StringBuffer getPlatformExtensionsStringImpl() { + StringBuffer sb = new StringBuffer(); if (!eglQueryStringInitialized) { eglQueryStringAvailable = getDrawableImpl().getGLDynamicLookupHelper().dynamicLookupFunction("eglQueryString") != 0; eglQueryStringInitialized = true; } if (eglQueryStringAvailable) { - String ret = EGL.eglQueryString(((EGLDrawable)drawable).getDisplay(), - EGL.EGL_EXTENSIONS); + final String ret = EGL.eglQueryString(((EGLDrawable)drawable).getDisplay(), + EGL.EGL_EXTENSIONS); if (DEBUG) { System.err.println("!!! EGL extensions: " + ret); } - return ret; - } else { - return ""; + sb.append(ret); } + return sb; } protected void setSwapIntervalImpl(int interval) { -- cgit v1.2.3