From d3a4046f5c45b8ef6e6f70115fcf6250e09a8732 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 2 Oct 2009 16:06:02 -0700 Subject: Pbuffer GLDrawableFactory integration (2) --- .../javax/media/opengl/GLDrawableFactory.java | 39 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index 48a8fe9e0..aade017eb 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -178,11 +178,22 @@ public abstract class GLDrawableFactory { } /** - * Returns a GLDrawable that wraps a platform-specific window system + * Returns a GLDrawable according to it's chosen Capabilities. + *

+ * The chosen Capabilties are referenced within the target + * NativeWindow's AbstractGraphicsConfiguration.

+ * + * In case {@link javax.media.nativewindow.Capabilties#isOnscreen()} is true,
+ * it wraps a platform-specific window system * object, such as an AWT or LCDUI Canvas. * On platforms which support pixel format, the NativeWindow's AbstractGraphicsConfiguration - * is being used. - * support it, selects a pixel format compatible with the supplied + * is being used, hence the chooser is redundant in this case. + *

+ * In case {@link javax.media.nativewindow.Capabilties#isOnscreen()} is false,
+ * either a Pbuffer drawable is created if {@link javax.media.opengl.GLCapabilities#isPBuffer()} is true,
+ * or a simple offscreen drawable is creates, the latter is unlikely to be hardware accelerated.
+ * The chooser will be used to determine the pixel format. + *

* GLCapabilities, or if the passed GLCapabilities object is null, * uses a default set of capabilities. On these platforms, uses * either the supplied GLCapabilitiesChooser object, or if the @@ -195,6 +206,12 @@ public abstract class GLDrawableFactory { * * @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen) */ + public abstract GLDrawable createGLDrawable(NativeWindow target, GLCapabilitiesChooser chooser) + throws IllegalArgumentException, GLException; + + /** + * @see #createGLDrawable(NativeWindow, GLCapabilitiesChooser) + */ public abstract GLDrawable createGLDrawable(NativeWindow target) throws IllegalArgumentException, GLException; @@ -207,6 +224,22 @@ public abstract class GLDrawableFactory { */ public abstract boolean canCreateGLPbuffer(); + /** + * Creates a GLPbuffer with the given drawable, which must be Pbuffer drawable, + * created by {@link #createGLDrawable}.

+ * + * See the note in the overview documentation on + * context sharing. + * + * @throws GLException if any window system-specific errors caused + * the creation of the GLPbuffer to fail. + * + * @see #createGLDrawable(NativeWindow, GLCapabilitiesChooser) + */ + public abstract GLPbuffer createGLPbuffer(GLDrawable pbufferDrawable, + GLContext shareWith) + throws GLException; + /** * Creates a GLPbuffer with the given capabilites and dimensions.

* -- cgit v1.2.3