aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/javax/media/opengl/GLCanvas.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-11-19 20:51:57 +0000
committerKenneth Russel <[email protected]>2006-11-19 20:51:57 +0000
commita303cd13ff62f94a0459978735620e37d72bbb77 (patch)
tree32b580af4e878d479890c12b8eae9c98e10a4874 /src/classes/javax/media/opengl/GLCanvas.java
parentbf82eceb6f78d5ee6e4c0f9f02590d2a58e647d3 (diff)
Fixed Issue 213: Expose GLCaps from GLDrawable
Added getChosenGLCapabilities() to the GLDrawable interface. Implemented on Windows, Unix and Mac OS X platforms with various techniques. Attempts to provide correct answers in all cases, even when the GLCapabilitiesChooser mechanism is not supported. Required addition of new platform-specific Java code in most cases to either re-convert existing PIXELFORMATDESCRIPTORS / XVisualInfos, or to query the pixel format or visual chosen for drawables like pbuffers for which the chooser mechanism is not (yet) implemented. Tested on Windows, Solaris/x86, and Mac OS X with on-screen, off-screen and pbuffer drawables. (Full support for the Java2D/JOGL bridge is not yet in place; the answer returned from the GLJPanel in this case is currently the default GLCapabilities, and it is likely that "external" GLDrawables will return null.) git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@989 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl/GLCanvas.java')
-rw-r--r--src/classes/javax/media/opengl/GLCanvas.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/classes/javax/media/opengl/GLCanvas.java b/src/classes/javax/media/opengl/GLCanvas.java
index 83072ffc5..3848cca2c 100644
--- a/src/classes/javax/media/opengl/GLCanvas.java
+++ b/src/classes/javax/media/opengl/GLCanvas.java
@@ -245,6 +245,13 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
maybeDoSingleThreadedWorkaround(swapBuffersOnEventDispatchThreadAction, swapBuffersAction);
}
+ public GLCapabilities getChosenGLCapabilities() {
+ if (drawable == null)
+ return null;
+
+ return drawable.getChosenGLCapabilities();
+ }
+
//----------------------------------------------------------------------
// Internals only below this point
//