diff options
Diffstat (limited to 'src/jogl/classes')
9 files changed, 28 insertions, 28 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index f1d8ff95e..580d3a50b 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -443,7 +443,7 @@ public abstract class GLDrawableFactory { * </p> * <p> * A Pbuffer drawable is created if both {@link GLCapabilitiesImmutable#isPBuffer() caps.isPBuffer()} - * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice) canCreateGLPbuffer(device)} is true. + * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true. * </p> * <p> * If not onscreen and neither FBO nor Pbuffer is available, @@ -454,7 +454,7 @@ public abstract class GLDrawableFactory { * @throws GLException if any window system-specific errors caused * the creation of the GLDrawable to fail. * - * @see #canCreateGLPbuffer(AbstractGraphicsDevice) + * @see #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) * @see GLContext#isFBOAvailable(AbstractGraphicsDevice, GLProfile) * @see javax.media.opengl.GLCapabilities#isOnscreen() * @see javax.media.opengl.GLCapabilities#isFBO() @@ -482,7 +482,7 @@ public abstract class GLDrawableFactory { * </p> * <p> * A Pbuffer based auto drawable is created if both {@link GLCapabilitiesImmutable#isPBuffer() caps.isPBuffer()} - * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice) canCreateGLPbuffer(device)} is true. + * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true. * </p> * <p> * If neither FBO nor Pbuffer is available, @@ -520,7 +520,7 @@ public abstract class GLDrawableFactory { * </p> * <p> * A Pbuffer drawable is created if both {@link GLCapabilitiesImmutable#isPBuffer() caps.isPBuffer()} - * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice) canCreateGLPbuffer(device)} is true. + * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true. * </p> * <p> * If neither FBO nor Pbuffer is available, @@ -590,12 +590,16 @@ public abstract class GLDrawableFactory { public abstract boolean canCreateFBO(AbstractGraphicsDevice device, GLProfile glp); /** - * Returns true if it is possible to create a GLPbuffer. Some older - * graphics cards do not have this capability. + * Returns true if it is possible to create an <i>pbuffer surface</i>. + * <p> + * Some older graphics cards do not have this capability, + * as well as some new GL implementation, i.e. OpenGL 3 core on OSX. + * </p> * * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device. + * @param glp {@link GLProfile} to check for FBO capabilities */ - public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device); + public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp); /** * Creates a GLPbuffer {@link GLAutoDrawable} with the given capabilites and dimensions. diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 6f4f6f271..996a47590 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1851,7 +1851,7 @@ public abstract class GLContextImpl extends GLContext { } @Override - public boolean isExtensionAvailable(String glExtensionName) { + public final boolean isExtensionAvailable(String glExtensionName) { if(null!=extensionAvailability) { return extensionAvailability.isExtensionAvailable(mapToRealGLExtensionName(glExtensionName)); } diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java index 4ac413545..41ea06deb 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java @@ -247,7 +247,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { // @Override - public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device); + public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp); @Override public GLPbuffer createGLPbuffer(AbstractGraphicsDevice deviceReq, @@ -263,7 +263,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { if(null == device) { throw new GLException("No shared device for requested: "+deviceReq); } - if ( !canCreateGLPbuffer(device) ) { + if ( !canCreateGLPbuffer(device, capsRequested.getGLProfile()) ) { throw new GLException("Pbuffer not available with device: "+device); } diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java index 48b509263..d54da4d28 100644 --- a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java +++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java @@ -200,8 +200,9 @@ public class GLGraphicsConfigurationUtil { if(null == device) { device = factory.getDefaultDevice(); } - final boolean fboAvailable = GLContext.isFBOAvailable(device, capsRequested.getGLProfile()); - final boolean pbufferAvailable = factory.canCreateGLPbuffer(device); + final GLProfile glp = capsRequested.getGLProfile(); + final boolean fboAvailable = GLContext.isFBOAvailable(device, glp); + final boolean pbufferAvailable = factory.canCreateGLPbuffer(device, glp); final GLRendererQuirks glrq = factory.getRendererQuirks(device); final boolean bitmapAvailable; diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index 465c8fa80..9c1cc7fc4 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -703,7 +703,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { } @Override - public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { + public boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) { // SharedResource sr = getOrCreateEGLSharedResource(device); // return sr.hasES1PBuffer() || sr.hasES2PBuffer(); return true; diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index 9b163ae5b..6787ef500 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -74,7 +74,6 @@ import com.jogamp.common.util.VersionNumber; import com.jogamp.common.util.locks.RecursiveLock; import com.jogamp.gluegen.runtime.ProcAddressTable; import com.jogamp.gluegen.runtime.opengl.GLProcAddressResolver; -import com.jogamp.opengl.GLExtensions; import com.jogamp.opengl.GLRendererQuirks; import com.jogamp.opengl.util.PMVMatrix; import com.jogamp.opengl.util.glsl.ShaderCode; @@ -465,15 +464,6 @@ public class MacOSXCGLContext extends GLContextImpl return new StringBuilder(); } - @Override - public boolean isExtensionAvailable(String glExtensionName) { - if (glExtensionName.equals(GLExtensions.ARB_pbuffer) || - glExtensionName.equals(GLExtensions.ARB_pixel_format)) { - return true; - } - return super.isExtensionAvailable(glExtensionName); - } - // Support for "mode switching" as described in MacOSXCGLDrawable public void setOpenGLMode(GLBackendType mode) { if (mode == openGLMode) { diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index c9402b33d..83d656475 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -332,8 +332,13 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } @Override - public boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { - return true; + public boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) { + if( glp.isGL2() ) { + // OSX only supports pbuffer w/ compatible, non-core, context. + return true; + } else { + return false; + } } @Override diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index 45edda516..338a351cb 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -470,7 +470,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { } @Override - public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { + public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) { SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice ); if(null!=sr) { return sr.hasARBPBuffer(); diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index b3b02e23f..52069b88f 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -490,7 +490,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { } @Override - public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device) { + public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) { if(null == device) { SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice); if(null!=sr) { @@ -551,7 +551,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { @Override public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) { - return canCreateGLPbuffer(device); + return canCreateGLPbuffer(device, null /* GLProfile not used for query on X11 */); } @Override |