aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/javax/media/opengl/AWTGraphicsDevice.java
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-11-09 23:40:33 +0000
committerKenneth Russel <[email protected]>2005-11-09 23:40:33 +0000
commitc3f4b1c7ccdd682f772fb0bdb67e3dd292ba9c06 (patch)
tree21f58338f25e986abe3c984ce1b6025552501367 /src/classes/javax/media/opengl/AWTGraphicsDevice.java
parent221199afb57829adac29f3b2988453b67331a324 (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/AWTGraphicsDevice.java')
-rw-r--r--src/classes/javax/media/opengl/AWTGraphicsDevice.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/classes/javax/media/opengl/AWTGraphicsDevice.java b/src/classes/javax/media/opengl/AWTGraphicsDevice.java
new file mode 100644
index 000000000..98c7ef2bf
--- /dev/null
+++ b/src/classes/javax/media/opengl/AWTGraphicsDevice.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ * You acknowledge that this software is not designed or intended for use
+ * in the design, construction, operation or maintenance of any nuclear
+ * facility.
+ *
+ * Sun gratefully acknowledges that this software was originally authored
+ * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ */
+
+package javax.media.opengl;
+
+import java.awt.GraphicsDevice;
+
+/** A wrapper for an AWT GraphicsDevice allowing it to be
+ handled in a toolkit-independent manner. */
+
+public class AWTGraphicsDevice implements AbstractGraphicsDevice {
+ private GraphicsDevice device;
+
+ public AWTGraphicsDevice(GraphicsDevice device) {
+ this.device = device;
+ }
+
+ public GraphicsDevice getGraphicsDevice() {
+ return device;
+ }
+}