aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/javax/media/opengl/awt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-03-13 11:55:23 +0000
committerSven Gothel <[email protected]>2009-03-13 11:55:23 +0000
commita74f1100b11eb3a6944a73eea48bf17d14ede8c1 (patch)
tree48a1d2e9fb9a7beb0c71ce016104022e79d736d3 /src/classes/javax/media/opengl/awt
parent3f0266e5d20216f68f515a943ad647d01e0ff567 (diff)
New package Native Window Interface 'java.media.nwi',
to loose JOGL dependencies for the moved interfaces, mainly NativeWindow. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1863 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/javax/media/opengl/awt')
-rw-r--r--src/classes/javax/media/opengl/awt/GLCanvas.java25
-rw-r--r--src/classes/javax/media/opengl/awt/GLJPanel.java43
2 files changed, 35 insertions, 33 deletions
diff --git a/src/classes/javax/media/opengl/awt/GLCanvas.java b/src/classes/javax/media/opengl/awt/GLCanvas.java
index e0d997dc5..42700b9e8 100644
--- a/src/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/classes/javax/media/opengl/awt/GLCanvas.java
@@ -40,6 +40,7 @@
package javax.media.opengl.awt;
import javax.media.opengl.*;
+import javax.media.nwi.*;
import java.awt.Canvas;
import java.awt.Color;
@@ -76,8 +77,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
private boolean sendReshape = false;
private GraphicsConfiguration chosen;
- private GLCapabilities glCaps;
- private GLCapabilitiesChooser glCapChooser;
+ private NWCapabilities glCaps;
+ private NWCapabilitiesChooser glCapChooser;
static {
// Default to the GL2 profile, which is the default on the desktop
@@ -96,15 +97,15 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
/** Creates a new GLCanvas component with the requested set of
OpenGL capabilities, using the default OpenGL capabilities
selection mechanism, on the default screen device. */
- public GLCanvas(GLCapabilities capabilities) {
+ public GLCanvas(NWCapabilities capabilities) {
this(capabilities, null, null, null);
}
- /** Creates a new GLCanvas component. The passed GLCapabilities
+ /** Creates a new GLCanvas component. The passed NWCapabilities
specifies the OpenGL capabilities for the component; if null, a
- default set of capabilities is used. The GLCapabilitiesChooser
+ default set of capabilities is used. The NWCapabilitiesChooser
specifies the algorithm for selecting one of the available
- GLCapabilities for the component; a DefaultGLCapabilitesChooser
+ NWCapabilities 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
@@ -115,8 +116,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
which to create the GLCanvas; the GLDrawableFactory uses the
default screen device of the local GraphicsEnvironment if null
is passed for this argument. */
- public GLCanvas(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public GLCanvas(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
GLContext shareWith,
GraphicsDevice device) {
// The platform-specific GLDrawableFactory will only provide a
@@ -407,11 +408,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
maybeDoSingleThreadedWorkaround(swapBuffersOnEventDispatchThreadAction, swapBuffersAction);
}
- public GLCapabilities getChosenGLCapabilities() {
+ public NWCapabilities getChosenNWCapabilities() {
if (drawable == null)
return null;
- return drawable.getChosenGLCapabilities();
+ return drawable.getChosenNWCapabilities();
}
public NativeWindow getNativeWindow() {
@@ -532,8 +533,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable {
}
}
- private static GraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ private static GraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
GraphicsDevice device) {
// Make GLCanvas behave better in NetBeans GUI builder
if (Beans.isDesignTime()) {
diff --git a/src/classes/javax/media/opengl/awt/GLJPanel.java b/src/classes/javax/media/opengl/awt/GLJPanel.java
index 37f1dfa7b..6711a5ed2 100644
--- a/src/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/classes/javax/media/opengl/awt/GLJPanel.java
@@ -40,6 +40,7 @@
package javax.media.opengl.awt;
import javax.media.opengl.*;
+import javax.media.nwi.*;
import java.awt.*;
import java.awt.geom.*;
@@ -63,7 +64,7 @@ import com.sun.opengl.impl.awt.*;
Z-ordering or LayoutManager problems. <P>
The GLJPanel can be made transparent by creating it with a
- GLCapabilities object with alpha bits specified and calling {@link
+ NWCapabilities object with alpha bits specified and calling {@link
#setOpaque}(false). Pixels with resulting OpenGL alpha values less
than 1.0 will be overlaid on any underlying Swing rendering. <P>
@@ -90,8 +91,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
private volatile boolean isInitialized;
// Data used for either pbuffers or pixmap-based offscreen surfaces
- private GLCapabilities offscreenCaps;
- private GLCapabilitiesChooser chooser;
+ private NWCapabilities offscreenCaps;
+ private NWCapabilitiesChooser chooser;
private GLContext shareWith;
// Width of the actual GLJPanel
private int panelWidth = 0;
@@ -158,33 +159,33 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
/** Creates a new GLJPanel component with the requested set of
OpenGL capabilities, using the default OpenGL capabilities
selection mechanism. */
- public GLJPanel(GLCapabilities capabilities) {
+ public GLJPanel(NWCapabilities capabilities) {
this(capabilities, null, null);
}
- /** Creates a new GLJPanel component. The passed GLCapabilities
+ /** Creates a new GLJPanel component. The passed NWCapabilities
specifies the OpenGL capabilities for the component; if null, a
- default set of capabilities is used. The GLCapabilitiesChooser
+ default set of capabilities is used. The NWCapabilitiesChooser
specifies the algorithm for selecting one of the available
- GLCapabilities for the component; a DefaultGLCapabilitesChooser
+ NWCapabilities 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. See the note in the overview documentation on
<a href="../../../overview-summary.html#SHARING">context sharing</a>.
*/
- public GLJPanel(GLCapabilities capabilities, GLCapabilitiesChooser chooser, GLContext shareWith) {
+ public GLJPanel(NWCapabilities capabilities, NWCapabilitiesChooser chooser, GLContext shareWith) {
super();
// Works around problems on many vendors' cards; we don't need a
// back buffer for the offscreen surface anyway
if (capabilities != null) {
- offscreenCaps = (GLCapabilities) capabilities.clone();
+ offscreenCaps = (NWCapabilities) capabilities.clone();
} else {
- offscreenCaps = new GLCapabilities();
+ offscreenCaps = new NWCapabilities();
}
offscreenCaps.setDoubleBuffered(false);
- this.chooser = ((chooser != null) ? chooser : new DefaultGLCapabilitiesChooser());
+ this.chooser = ((chooser != null) ? chooser : new DefaultNWCapabilitiesChooser());
this.shareWith = shareWith;
}
@@ -391,8 +392,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
return oglPipelineEnabled;
}
- public GLCapabilities getChosenGLCapabilities() {
- return backend.getChosenGLCapabilities();
+ public NWCapabilities getChosenNWCapabilities() {
+ return backend.getChosenNWCapabilities();
}
public NativeWindow getNativeWindow() {
@@ -578,8 +579,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
// Called to get the current backend's GLContext
public GLContext getContext();
- // Called to fetch the "real" chosen GLCapabilities for the backend
- public GLCapabilities getChosenGLCapabilities();
+ // Called to fetch the "real" chosen NWCapabilities for the backend
+ public NWCapabilities getChosenNWCapabilities();
// Called to handle a reshape event. When this is called, the
// OpenGL context associated with the backend is not current, to
@@ -815,11 +816,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
return offscreenContext;
}
- public GLCapabilities getChosenGLCapabilities() {
+ public NWCapabilities getChosenNWCapabilities() {
if (offscreenDrawable == null) {
return null;
}
- return offscreenDrawable.getChosenGLCapabilities();
+ return offscreenDrawable.getChosenNWCapabilities();
}
public void handleReshape() {
@@ -902,11 +903,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
return pbuffer.getContext();
}
- public GLCapabilities getChosenGLCapabilities() {
+ public NWCapabilities getChosenNWCapabilities() {
if (pbuffer == null) {
return null;
}
- return pbuffer.getChosenGLCapabilities();
+ return pbuffer.getChosenNWCapabilities();
}
public void handleReshape() {
@@ -1069,9 +1070,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable {
return joglContext;
}
- public GLCapabilities getChosenGLCapabilities() {
+ public NWCapabilities getChosenNWCapabilities() {
// FIXME: should do better than this; is it possible to using only platform-independent code?
- return new GLCapabilities();
+ return new NWCapabilities();
}
public void handleReshape() {