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/GLCanvas.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/GLCanvas.java')
-rw-r--r-- | src/jogl/classes/javax/media/opengl/awt/GLCanvas.java | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java index 160cdce51..80e042dd3 100644 --- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java +++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java @@ -165,17 +165,20 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing /** Creates a new GLCanvas component with a default set of OpenGL capabilities, using the default OpenGL capabilities selection - mechanism, on the default screen device. */ - public GLCanvas() { + mechanism, on the default screen device. + * @throws GLException if no default profile is available for the default desktop device. + */ + public GLCanvas() throws GLException { this(null); } /** Creates a new GLCanvas component with the requested set of OpenGL capabilities, using the default OpenGL capabilities selection mechanism, on the default screen device. + * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice) */ - public GLCanvas(GLCapabilitiesImmutable capsReqUser) { + public GLCanvas(GLCapabilitiesImmutable capsReqUser) throws GLException { this(capsReqUser, null, null, null); } @@ -184,9 +187,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing selection mechanism, on the default screen device. * This constructor variant also supports using a shared GLContext. * + * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice) */ - public GLCanvas(GLCapabilitiesImmutable capsReqUser, GLContext shareWith) { + public GLCanvas(GLCapabilitiesImmutable capsReqUser, GLContext shareWith) + throws GLException + { this(capsReqUser, null, shareWith, null); } @@ -204,11 +210,15 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing sharing</a>. 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. */ + is passed for this argument. + * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device. + */ public GLCanvas(GLCapabilitiesImmutable capsReqUser, GLCapabilitiesChooser chooser, GLContext shareWith, - GraphicsDevice device) { + GraphicsDevice device) + throws GLException + { /* * Determination of the native window is made in 'super.addNotify()', * which creates the native peer using AWT's GraphicsConfiguration. |