diff options
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl')
-rw-r--r-- | src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java | 15 | ||||
-rw-r--r-- | src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java | 12 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java index a2d0e0150..9ea599b30 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java @@ -57,7 +57,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { //--------------------------------------------------------------------------- // Dispatching GLDrawable construction in respect to the NativeWindow Capabilities // - public GLDrawable createGLDrawable(NativeWindow target) { + public GLDrawable createGLDrawable(NativeWindow target, GLCapabilitiesChooser chooser) { if (target == null) { throw new IllegalArgumentException("Null target"); } @@ -74,13 +74,13 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { if(caps.isPBuffer() && canCreateGLPbuffer()) { // PBUFFER result = createGLPbufferDrawable(caps, - null /* GLCapabilitiesChooser */, + chooser, target.getWidth(), target.getHeight()); } if(null==result) { result = createOffscreenDrawable(caps, - null /* GLCapabilitiesChooser */, + chooser, target.getWidth(), target.getHeight()); } @@ -91,6 +91,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { return result; } + public GLDrawable createGLDrawable(NativeWindow target) { + return createGLDrawable(target, null); + } + /** Creates a (typically hw-accelerated) Pbuffer GLDrawable. */ public abstract GLDrawableImpl createGLPbufferDrawable(GLCapabilities capabilities, GLCapabilitiesChooser chooser, @@ -108,6 +112,11 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { /** Creates a (typically hw-accelerated) onscreen GLDrawable. */ public abstract GLDrawableImpl createOnscreenDrawable(NativeWindow target); + public GLPbuffer createGLPbuffer(GLDrawable pbufferDrawable, + GLContext shareWith) { + return new GLPbufferImpl((GLDrawableImpl)pbufferDrawable, shareWith); + } + protected GLDrawableFactoryImpl() { super(); } diff --git a/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java index 8aba26fc6..966b1e63e 100644 --- a/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java +++ b/src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java @@ -62,6 +62,18 @@ public class GLPbufferImpl implements GLPbuffer { public GLPbufferImpl(GLDrawableImpl pbufferDrawable, GLContext parentContext) { + GLCapabilities caps = (GLCapabilities) + pbufferDrawable.getNativeWindow().getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities(); + if(caps.isOnscreen()) { + if(caps.isPBuffer()) { + throw new IllegalArgumentException("Error: Given drawable is Onscreen and Pbuffer: "+pbufferDrawable); + } + throw new IllegalArgumentException("Error: Given drawable is Onscreen: "+pbufferDrawable); + } else { + if(!caps.isPBuffer()) { + throw new IllegalArgumentException("Error: Given drawable is not Pbuffer: "+pbufferDrawable); + } + } this.pbufferDrawable = pbufferDrawable; context = (GLContextImpl) pbufferDrawable.createContext(parentContext); context.setSynchronized(true); |