diff options
author | Kenneth Russel <[email protected]> | 2005-11-09 23:40:33 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-11-09 23:40:33 +0000 |
commit | c3f4b1c7ccdd682f772fb0bdb67e3dd292ba9c06 (patch) | |
tree | 21f58338f25e986abe3c984ce1b6025552501367 /src/classes/javax/media/opengl/GLJPanel.java | |
parent | 221199afb57829adac29f3b2988453b67331a324 (diff) |
Made public API changes discussed with expert group to make core JOGL
API more toolkit-agnostic:
1. Decoupled instantiation of GLCanvas and GLJPanel objects from the
GLDrawableFactory. GLCanvas and GLJPanel's constructors are now
public and the associated factory methods have been removed from
the GLDrawableFactory.
2. Changed the signature of GLDrawableFactory.
chooseGraphicsConfiguration() to accept and return marker
AbstractGraphicsDevice and AbstractGraphicsConfiguration
interfaces, respectively. Defined new AWTGraphicsDevice and
AWTGraphicsConfiguration wrapper classes simply wrapping the
associated objects. An SWT port could define similar wrapper
classes for its data types.
3. Allowed overriding of the specific GLDrawableFactory subclass
instantiated through GLDrawableFactory.getFactory() by setting the
system property "opengl.factory.class.name". For example, an SWT
port might swap itself in by specifying the following system
property on the command line:
-Dopengl.factory.class.name=com.ibm.swt.opengl.SWTGLDrawableFactory
Tested on Solaris/SPARC. Also fixed breakage on Solaris/SPARC due to
recent split of jogl native library into jogl and jogl_awt pieces.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@431 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl/GLJPanel.java')
-rw-r--r-- | src/classes/javax/media/opengl/GLJPanel.java | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/src/classes/javax/media/opengl/GLJPanel.java b/src/classes/javax/media/opengl/GLJPanel.java index d2d14c7b7..5460bc0cd 100644 --- a/src/classes/javax/media/opengl/GLJPanel.java +++ b/src/classes/javax/media/opengl/GLJPanel.java @@ -166,16 +166,30 @@ public class GLJPanel extends JPanel implements GLAutoDrawable { private int viewportX; private int viewportY; - /** Creates a new GLJPanel component. The passed GLCapabilities must - be non-null and specifies the OpenGL capabilities for the - component. The GLCapabilitiesChooser must be non-null and + /** Creates a new GLJPanel component with a default set of OpenGL + capabilities and using the default OpenGL capabilities selection + mechanism. */ + public GLJPanel() { + this(null); + } + + /** Creates a new GLJPanel component with the requested set of + OpenGL capabilities, using the default OpenGL capabilities + selection mechanism. */ + public GLJPanel(GLCapabilities capabilities) { + this(capabilities, null, null); + } + + /** Creates a new GLJPanel component. The passed GLCapabilities + specifies the OpenGL capabilities for the component; if null, a + default set of capabilities is used. The GLCapabilitiesChooser specifies the algorithm for selecting one of the available - GLCapabilities for the component; the GLDrawableFactory uses a - DefaultGLCapabilitiesChooser if the user does not provide - one. The passed GLContext may be null and specifies an OpenGL - context with which to share textures, display lists and other - OpenGL state. */ - protected GLJPanel(GLCapabilities capabilities, GLCapabilitiesChooser chooser, GLContext shareWith) { + GLCapabilities for the component; a DefaultGLCapabilitesChooser + 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. */ + public GLJPanel(GLCapabilities capabilities, GLCapabilitiesChooser chooser, GLContext shareWith) { super(); // Works around problems on many vendors' cards; we don't need a |