From b5dd8c190c83e9b0059093eb01f60379b1bfe256 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Wed, 15 Feb 2006 20:13:12 +0000 Subject: Added note on limitations of OpenGL context sharing to spec overview and pointed to it from GLDrawableFactory, GLDrawable, GLCanvas and GLJPanel git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@611 232f8b59-042b-4e1e-8c03-345bb8c30851 --- make/spec-overview.html | 14 ++++++++++++++ src/classes/javax/media/opengl/GLCanvas.java | 11 +++++++---- src/classes/javax/media/opengl/GLDrawable.java | 6 ++++-- src/classes/javax/media/opengl/GLDrawableFactory.java | 5 ++++- src/classes/javax/media/opengl/GLJPanel.java | 4 +++- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/make/spec-overview.html b/make/spec-overview.html index c8c45142a..a187e2c51 100644 --- a/make/spec-overview.html +++ b/make/spec-overview.html @@ -199,6 +199,20 @@ which a separate thread attempts to alter the contents of the argument during the time interval following validation but preceding passage of the argument to the underlying native engine.
+

Sharing of Server-Side OpenGL Objects between GLContexts

+ +Sharing of server-side OpenGL objects such as textures and display +lists among OpenGL contexts is supported in this specification. +However, the specification does not guarantee that a request to share +objects between two contexts will succeed. Certain OpenGL +implementations restrict sharing in certain ways. Applications should +assume that sharing is a request more than an assertion. +Implementations of this specification should, but are not required to, +provide timely notification of a failure of a request to share objects +between two GLContexts, perhaps in the form of a GLException. The +situation in which sharing is most likely to work on all platforms is +between two GLContexts associated with the same GLDrawable. +

Criteria Used for Inclusion of APIs into the Java Bindings

OpenGL API Inclusion Criteria

diff --git a/src/classes/javax/media/opengl/GLCanvas.java b/src/classes/javax/media/opengl/GLCanvas.java index b6c1ca0d0..0329e4017 100644 --- a/src/classes/javax/media/opengl/GLCanvas.java +++ b/src/classes/javax/media/opengl/GLCanvas.java @@ -90,10 +90,13 @@ public class GLCanvas extends Canvas implements GLAutoDrawable { is used if null is passed for this argument. The passed GLContext specifies an OpenGL context with which to share textures, display lists and other OpenGL state, and may be null - if sharing is not desired. The passed GraphicsDevice indicates - the screen on which to create the GLCanvas; the - GLDrawableFactory uses the default screen device of the local - GraphicsEnvironment if null is passed for this argument. */ + if sharing is not desired. See the note in the overview + documentation on context + sharing. The passed GraphicsDevice indicates the screen on + which to create the GLCanvas; the GLDrawableFactory uses the + default screen device of the local GraphicsEnvironment if null + is passed for this argument. */ public GLCanvas(GLCapabilities capabilities, GLCapabilitiesChooser chooser, GLContext shareWith, diff --git a/src/classes/javax/media/opengl/GLDrawable.java b/src/classes/javax/media/opengl/GLDrawable.java index a1780bd2a..13b905167 100644 --- a/src/classes/javax/media/opengl/GLDrawable.java +++ b/src/classes/javax/media/opengl/GLDrawable.java @@ -71,11 +71,13 @@ public interface GLDrawable { /** * Creates a new context for drawing to this drawable that will * optionally share display lists and other server-side OpenGL - * objects with the specified GLContext. + * objects with the specified GLContext.

* * The GLContext share need not be associated with this * GLDrawable and may be null if sharing of display lists and other - * objects is not desired. + * objects is not desired. See the note in the overview + * documentation on + * context sharing. */ public GLContext createContext(GLContext shareWith); diff --git a/src/classes/javax/media/opengl/GLDrawableFactory.java b/src/classes/javax/media/opengl/GLDrawableFactory.java index ded3a0304..fd934195c 100644 --- a/src/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/classes/javax/media/opengl/GLDrawableFactory.java @@ -186,7 +186,10 @@ public abstract class GLDrawableFactory { public abstract boolean canCreateGLPbuffer(); /** - * Creates a GLPbuffer with the given capabilites and dimensions. + * Creates a GLPbuffer with the given capabilites and dimensions.

+ * + * 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. diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java index dbc5e432a..086e7c055 100644 --- a/src/classes/javax/media/opengl/GLJPanel.java +++ b/src/classes/javax/media/opengl/GLJPanel.java @@ -213,7 +213,9 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { is used if null is passed for this argument. The passed GLContext specifies an OpenGL context with which to share textures, display lists and other OpenGL state, and may be null - if sharing is not desired. */ + if sharing is not desired. See the note in the overview documentation on + context sharing. + */ public GLJPanel(GLCapabilities capabilities, GLCapabilitiesChooser chooser, GLContext shareWith) { super(); -- cgit v1.2.3