diff options
Diffstat (limited to 'src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java')
-rw-r--r-- | src/jogl/classes/com/sun/opengl/impl/GLPbufferImpl.java | 12 |
1 files changed, 12 insertions, 0 deletions
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); |