diff options
author | Sven Gothel <[email protected]> | 2011-07-07 03:39:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-07-07 03:39:43 +0200 |
commit | 29cc5fa0375026c09bcbfed16627fe9eb6c97846 (patch) | |
tree | aefd65d00e5e9a6fa4e28a54f090737d65d37f09 /src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | |
parent | c9903cf9d4ceda09ec07ef340f8aa3d0a104e23a (diff) |
GLProfile: Initialization fix and clarifications ( GLExceptions on n/a profiles )
- GLProfile.initSingleton(boolean) (implicit or explicit) won't
throw any exception anymore. Followup 'GLProfile GLProfile.get(..)'
calls will throw a GLException, if n/a.
Availability maybe queried via GLProfile.isAvailable(..).
- GLCapabilties, GLCanvas, GLJPanel: Clarify case where GLException maybe thrown,
i.e. no default GLProfile available on default device.
- Remove redundant GLProfile.is<ProfileName>Available(..)
Diffstat (limited to 'src/jogl/classes/javax/media/opengl/awt/GLJPanel.java')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLJPanel.java | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java index 2d58584f7..76d982813 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java @@ -199,15 +199,19 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing /** Creates a new GLJPanel component with a default set of OpenGL capabilities and using the default OpenGL capabilities selection - mechanism. */ - public GLJPanel() { + mechanism. + * @throws GLException if no default profile is available for the default desktop device. + */ + public GLJPanel() throws GLException { this(null); } /** Creates a new GLJPanel component with the requested set of OpenGL capabilities, using the default OpenGL capabilities - selection mechanism. */ - public GLJPanel(GLCapabilitiesImmutable userCapsRequest) { + selection mechanism. + * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. + */ + public GLJPanel(GLCapabilitiesImmutable userCapsRequest) throws GLException { this(userCapsRequest, null, null); } @@ -224,8 +228,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing <P> Note: Sharing cannot be enabled using J2D OpenGL FBO sharing, since J2D GL Context must be shared and we can only share one context. + * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. */ - public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser, GLContext shareWith) { + public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser, GLContext shareWith) + throws GLException + { super(); // Works around problems on many vendors' cards; we don't need a @@ -235,7 +242,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing if (userCapsRequest != null) { caps = (GLCapabilities) userCapsRequest.cloneMutable(); } else { - caps = new GLCapabilities(null); + caps = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDesktopDevice())); } caps.setDoubleBuffered(false); offscreenCaps = caps; |