/** * Determines whether the chosen {@link GLCapabilitiesImmutable} * requires a {@link GLDrawable#swapBuffers() swap-buffers} * before reading pixels. * <p> * Usually one uses the {@link GLBase#getDefaultReadBuffer() default-read-buffer} * in which case {@link GLDrawable#swapBuffers() swap-buffers} shall happen <b>after</b> calling reading pixels, the default. * </p> * <p> * However, <i>multisampling</i> offscreen {@link javax.media.opengl.GLFBODrawable}s * utilize {@link GLDrawable#swapBuffers() swap-buffers} to <i>downsample</i> * the multisamples into the readable sampling sink. * In this case, we require {@link GLDrawable#swapBuffers() swap-buffers} <b>before</b> reading pixels. * </p> * @return chosenCaps.isFBO() && chosenCaps.getSampleBuffers() */ public static final boolean swapBuffersBeforeRead(final GLCapabilitiesImmutable chosenCaps) { return chosenCaps.isFBO() && chosenCaps.getSampleBuffers(); } }
caps.getAccumBlueBits() + caps.getAccumAlphaBits() ) ); if (caps.getSampleBuffers()) { attrs.put(i++, CGL.kCGLPFASampleBuffers); attrs.put(i++, 1);
res.put(idx++, caps.getAccumAlphaBits()); if (isMultisampleAvailable && caps.getSampleBuffers()) { res.put(idx++, GLX.GLX_SAMPLE_BUFFERS); res.put(idx++, GL.GL_TRUE);
if (caps.getSampleBuffers() && sharedResource.hasARBMultisample()) { iattributes.put(niattribs++, WGLExt.WGL_SAMPLE_BUFFERS_ARB); iattributes.put(niattribs++, GL.GL_TRUE);
ivalues.put(idx, caps.getSampleBuffers() ? 1 : 0); break;
attrs.put(idx++, caps.getDepthBits()); if(caps.getSampleBuffers()) { if(caps.getSampleExtension().equals(GLGraphicsConfigurationUtil.NV_coverage_sample)) { attrs.put(idx++, EGLExt.EGL_COVERAGE_BUFFERS_NV);
if( ( chosenCapsA.isOnscreen() && !chosenCapsB.isOnscreen() || !chosenCapsA.isOnscreen() && chosenCapsB.isOnscreen() ) && // switching between on- and offscreen ( chosenCapsA.getSampleBuffers() || chosenCapsB.getSampleBuffers() ) || // MSAA involved
@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; }