public static final boolean isLockedByOtherThread(final GLAutoDrawable d) { final Thread currentThread = Thread.currentThread(); final Thread upstreamLockOwner = d.getUpstreamLock().getOwner(); if( null != upstreamLockOwner && currentThread != upstreamLockOwner ) { return true; } else { final NativeSurface s = d.getNativeSurface(); final Thread surfaceLockOwner = null != s ? s.getSurfaceLockOwner() : null; return null != surfaceLockOwner && currentThread != surfaceLockOwner; } }
public static final boolean isLockedByThisThread(final GLAutoDrawable d) { final Thread currentThread = Thread.currentThread(); final Thread upstreamLockOwner = d.getUpstreamLock().getOwner(); if( currentThread == upstreamLockOwner ) { return true; } else { final NativeSurface s = d.getNativeSurface(); final Thread surfaceLockOwner = null != s ? s.getSurfaceLockOwner() : null; return currentThread == surfaceLockOwner; } }
@Override public void init(final GLAutoDrawable drawable) { final GL gl = drawable.getGL(); System.err.println(JoglVersion.getGLInfo(gl, null)); System.err.println("Requested: "+drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()); System.err.println("Chosen : "+drawable.getChosenGLCapabilities()); System.err.println("GL impl. class "+gl.getClass().getName()); if( gl.isGL4ES3() ) { final GL4ES3 _gl = gl.getGL4ES3(); System.err.println("GL4ES3 retrieved, impl. class "+_gl.getClass().getName()); } if( gl.isGL3() ) { final GL3 _gl = gl.getGL3(); System.err.println("GL3 retrieved, impl. class "+_gl.getClass().getName()); } if( gl.isGLES3() ) { final GLES3 _gl = gl.getGLES3(); System.err.println("GLES3 retrieved, impl. class "+_gl.getClass().getName()); } if( gl.isGLES2() ) { final GLES2 _gl = gl.getGLES2(); System.err.println("GLES2 retrieved, impl. class "+_gl.getClass().getName()); } }
/** * Convenient wrapper for {@link GLDrawableFactory#resetDisplayGamma(javax.media.nativewindow.NativeSurface)} * locking {@link GLAutoDrawable#getUpstreamLock()} to ensure proper atomic operation. */ public static void resetDisplayGamma(final GLAutoDrawable drawable) { final RecursiveLock lock = drawable.getUpstreamLock(); lock.lock(); try { GLDrawableFactory.getFactory(drawable.getGLProfile()).resetDisplayGamma(drawable.getNativeSurface()); } finally { lock.unlock(); } }
/** * Convenient wrapper for {@link GLDrawableFactory#setDisplayGamma(javax.media.nativewindow.NativeSurface, float, float, float)} * locking {@link GLAutoDrawable#getUpstreamLock()} to ensure proper atomic operation. */ public static boolean setDisplayGamma(final GLAutoDrawable drawable, final float gamma, final float brightness, final float contrast) throws IllegalArgumentException { final RecursiveLock lock = drawable.getUpstreamLock(); lock.lock(); try { return GLDrawableFactory.getFactory(drawable.getGLProfile()).setDisplayGamma(drawable.getNativeSurface(), gamma, brightness, contrast); } finally { lock.unlock(); } }
srcUpstreamLock.lock(); try { final NativeSurface srcSurface = src.getNativeSurface(); final boolean srcSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < srcSurface.lockSurface(); if( src.isRealized() && !srcSurfaceLocked ) {
final boolean destIsRealized; try { final NativeSurface destSurface = dest.getNativeSurface(); final boolean destSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < destSurface.lockSurface(); if( dest.isRealized() && !destSurfaceLocked ) {
bUpstreamLock.lock(); try { final NativeSurface aSurface = a.getNativeSurface(); final boolean aSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface(); if( a.isRealized() && !aSurfaceLocked ) { throw new GLException("Could not lock realized a surface "+a); final NativeSurface bSurface = b.getNativeSurface(); final boolean bSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < bSurface.lockSurface(); if( b.isRealized() && !bSurfaceLocked ) {