/** Fix double buffered setting */ public static GLCapabilitiesImmutable fixDoubleBufferedGLCapabilities(final GLCapabilitiesImmutable capsRequested, final boolean doubleBuffered) { if( capsRequested.getDoubleBuffered() != doubleBuffered) { final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable(); caps2.setDoubleBuffered(doubleBuffered); return caps2; } return capsRequested; }
/** Callback for special implementations, allowing GLContext to fetch a custom default read buffer of current framebuffer. */ protected int getDefaultReadBuffer(final GL gl, final boolean hasDedicatedDrawableRead) { if( gl.isGLES() || hasDedicatedDrawableRead || getChosenGLCapabilities().getDoubleBuffered() ) { // Note-1: Neither ES1 nor ES2 supports selecting the read buffer via glReadBuffer // Note-2: ES3 only supports GL_BACK, GL_NONE or GL_COLOR_ATTACHMENT0+i return GL.GL_BACK; } return GL.GL_FRONT ; }
final public static String[] getGLInfos(GLAutoDrawable drawable) { GL gl = drawable.getGL(); GLCapabilitiesImmutable c = drawable.getChosenGLCapabilities(); String[] ret = { c + "", c.getDoubleBuffered() + "", c.getStereo() + "", c.getStencilBits() + "", gl.getClass().getName(), gl.glGetString(GL.GL_VENDOR), gl.glGetString(GL.GL_RENDERER), gl.glGetString(GL.GL_VERSION) }; return ret; }
res.put(idx++, caps.getDoubleBuffered()?GL.GL_TRUE:GL.GL_FALSE); res.put(idx++, GLX.GLX_STEREO); res.put(idx++, caps.getStereo()?GL.GL_TRUE:GL.GL_FALSE); if (caps.getDoubleBuffered()) { res.put(idx++, GLX.GLX_DOUBLEBUFFER);
if (caps.getDoubleBuffered()) { attrs.put(i++, CGL.kCGLPFADoubleBuffer);
if (caps.getDoubleBuffered()) { iattributes.put(niattribs++, GL.GL_TRUE); } else {
ivalues.put(idx, (caps.getDoubleBuffered() ? 1 : 0)); break;
if(doubleBuffered && !caps.getDoubleBuffered()) { return 1; } else if(!doubleBuffered && caps.getDoubleBuffered()) { return -1;
if (cur.getDoubleBuffered() != gldes.getDoubleBuffered()) { score += sign(score) * DOUBLE_BUFFER_MISMATCH_PENALTY;
@Override public final void swapBuffers() throws GLException { if( !realized ) { // volatile OK (locked below) return; // destroyed already } final int lockRes = lockSurface(); // it's recursive, so it's ok within [makeCurrent .. release] if (NativeSurface.LOCK_SURFACE_NOT_READY == lockRes) { return; } try { if( realized ) { // volatile OK final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable)surface.getGraphicsConfiguration().getChosenCapabilities(); if ( caps.getDoubleBuffered() ) { if(!surface.surfaceSwap()) { swapBuffersImpl(true); } } else { final GLContext ctx = GLContext.getCurrent(); if(null!=ctx && ctx.getGLDrawable()==this) { ctx.getGL().glFlush(); } swapBuffersImpl(false); } } } finally { unlockSurface(); } surface.surfaceUpdated(this, surface, System.currentTimeMillis()); }
@Override public boolean equals(final Object obj) { if(this == obj) { return true; } if(!(obj instanceof GLCapabilitiesImmutable)) { return false; } final GLCapabilitiesImmutable other = (GLCapabilitiesImmutable)obj; boolean res = super.equals(obj) && other.getGLProfile()==glProfile && other.isPBuffer()==isPBuffer && other.isFBO()==isFBO && other.getDoubleBuffered() == doubleBuffered && other.getStereo()==stereo && other.getHardwareAccelerated()==hardwareAccelerated && other.getDepthBits()==depthBits && other.getStencilBits()==stencilBits && other.getAccumRedBits()==accumRedBits && other.getAccumGreenBits()==accumGreenBits && other.getAccumBlueBits()==accumBlueBits && other.getAccumAlphaBits()==accumAlphaBits && other.getSampleBuffers()==sampleBuffers; if(res && sampleBuffers) { res = other.getNumSamples()==getNumSamples() && other.getSampleExtension().equals(sampleExtension) ; } return res; }
/** * Copies all {@link GLCapabilitiesImmutable} values * from <code>source</code> into this instance. * @return this instance */ public GLCapabilities copyFrom(final GLCapabilitiesImmutable source) { super.copyFrom(source); glProfile = source.getGLProfile(); isPBuffer = source.isPBuffer(); isFBO = source.isFBO(); doubleBuffered = source.getDoubleBuffered(); stereo = source.getStereo(); hardwareAccelerated = source.getHardwareAccelerated(); depthBits = source.getDepthBits(); stencilBits = source.getStencilBits(); accumRedBits = source.getAccumRedBits(); accumGreenBits = source.getAccumGreenBits(); accumBlueBits = source.getAccumBlueBits(); accumAlphaBits = source.getAccumAlphaBits(); sampleBuffers = source.getSampleBuffers(); numSamples = source.getNumSamples(); sampleExtension = source.getSampleExtension(); return this; }
if( capsRequested.getDoubleBuffered() && ( capsRequested.isPBuffer() && glrq.exist(GLRendererQuirks.NoDoubleBufferedPBuffer) ) || ( capsRequested.isBitmap() && glrq.exist(GLRendererQuirks.NoDoubleBufferedBitmap) ) ) { usePbuffer != capsRequested.isPBuffer() || useBitmap != capsRequested.isBitmap() || !doubleBufferAvailable && capsRequested.getDoubleBuffered() )
if ( caps.getDoubleBuffered() ) { if( caps.isBitmap() || caps.isPBuffer() ) {