aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/javax/media
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
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')
-rw-r--r--src/classes/javax/media/nwi/DefaultNWCapabilitiesChooser.java (renamed from src/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java)26
-rw-r--r--src/classes/javax/media/nwi/NWCapabilities.java (renamed from src/classes/javax/media/opengl/GLCapabilities.java)14
-rw-r--r--src/classes/javax/media/nwi/NWCapabilitiesChooser.java (renamed from src/classes/javax/media/opengl/GLCapabilitiesChooser.java)14
-rw-r--r--src/classes/javax/media/nwi/NativeWindow.java (renamed from src/classes/javax/media/opengl/NativeWindow.java)2
-rw-r--r--src/classes/javax/media/nwi/NativeWindowException.java (renamed from src/classes/javax/media/opengl/NativeWindowException.java)2
-rw-r--r--src/classes/javax/media/opengl/GLDrawable.java6
-rw-r--r--src/classes/javax/media/opengl/GLDrawableFactory.java32
-rw-r--r--src/classes/javax/media/opengl/GLPbuffer.java4
-rw-r--r--src/classes/javax/media/opengl/NativeWindowFactory.java9
-rw-r--r--src/classes/javax/media/opengl/X11GraphicsConfiguration.java2
-rw-r--r--src/classes/javax/media/opengl/X11GraphicsDevice.java2
-rw-r--r--src/classes/javax/media/opengl/awt/GLCanvas.java25
-rw-r--r--src/classes/javax/media/opengl/awt/GLJPanel.java43
13 files changed, 95 insertions, 86 deletions
diff --git a/src/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/classes/javax/media/nwi/DefaultNWCapabilitiesChooser.java
index 5147ab8b7..1318ea419 100644
--- a/src/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
+++ b/src/classes/javax/media/nwi/DefaultNWCapabilitiesChooser.java
@@ -37,23 +37,21 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
-package javax.media.opengl;
-
-import com.sun.opengl.impl.Debug;
+package javax.media.nwi;
/** <P> The default implementation of the {@link
- GLCapabilitiesChooser} interface, which provides consistent visual
+ NWCapabilitiesChooser} interface, which provides consistent visual
selection behavior across platforms. The precise algorithm is
deliberately left loosely specified. Some properties are: </P>
<UL>
<LI> As long as there is at least one available non-null
- GLCapabilities which matches the "stereo" option, will return a
+ NWCapabilities which matches the "stereo" option, will return a
valid index.
<LI> Attempts to match as closely as possible the given
- GLCapabilities, but will select one with fewer capabilities (i.e.,
+ NWCapabilities, but will select one with fewer capabilities (i.e.,
lower color depth) if necessary.
<LI> Prefers hardware-accelerated visuals to
@@ -79,11 +77,11 @@ import com.sun.opengl.impl.Debug;
</UL>
*/
-public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
- private static final boolean DEBUG = Debug.debug("DefaultGLCapabilitiesChooser");
+public class DefaultNWCapabilitiesChooser implements NWCapabilitiesChooser {
+ private static final boolean DEBUG = false; // FIXME: Debug.debug("DefaultNWCapabilitiesChooser");
- public int chooseCapabilities(GLCapabilities desired,
- GLCapabilities[] available,
+ public int chooseCapabilities(NWCapabilities desired,
+ NWCapabilities[] available,
int windowSystemRecommendedChoice) {
if (DEBUG) {
System.err.println("Desired: " + desired);
@@ -120,7 +118,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
}
// Compute score for each
for (int i = 0; i < scores.length; i++) {
- GLCapabilities cur = available[i];
+ NWCapabilities cur = available[i];
if (cur == null) {
continue;
}
@@ -159,7 +157,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
if (score == NO_SCORE) {
continue;
}
- GLCapabilities cur = available[i];
+ NWCapabilities cur = available[i];
if (cur.getHardwareAccelerated()) {
int absScore = Math.abs(score);
if (!gotHW ||
@@ -175,7 +173,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
if (score == NO_SCORE) {
continue;
}
- GLCapabilities cur = available[i];
+ NWCapabilities cur = available[i];
if (!cur.getHardwareAccelerated()) {
if (score <= 0) {
score -= maxAbsoluteHWScore;
@@ -215,7 +213,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
}
}
if (chosenIndex < 0) {
- throw new GLException("Unable to select one of the provided GLCapabilities");
+ throw new NativeWindowException("Unable to select one of the provided NWCapabilities");
}
if (DEBUG) {
System.err.println("Chosen index: " + chosenIndex);
diff --git a/src/classes/javax/media/opengl/GLCapabilities.java b/src/classes/javax/media/nwi/NWCapabilities.java
index 8f89f605c..cc3ebb77c 100644
--- a/src/classes/javax/media/opengl/GLCapabilities.java
+++ b/src/classes/javax/media/nwi/NWCapabilities.java
@@ -37,14 +37,14 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
-package javax.media.opengl;
+package javax.media.nwi;
/** Specifies a set of OpenGL capabilities that a rendering context
must support, such as color depth and whether stereo is enabled.
It currently contains the minimal number of routines which allow
configuration on all supported window systems. */
-public class GLCapabilities implements Cloneable {
+public class NWCapabilities implements Cloneable {
private boolean doubleBuffered = true;
private boolean stereo = false;
private boolean hardwareAccelerated = true;
@@ -74,16 +74,16 @@ public class GLCapabilities implements Cloneable {
private boolean pbufferRenderToTexture;
private boolean pbufferRenderToTextureRectangle;
- /** Creates a GLCapabilities object. All attributes are in a default
+ /** Creates a NWCapabilities object. All attributes are in a default
state.
*/
- public GLCapabilities() {}
+ public NWCapabilities() {}
public Object clone() {
try {
return super.clone();
} catch (CloneNotSupportedException e) {
- throw new GLException(e);
+ throw new NativeWindowException(e);
}
}
@@ -343,10 +343,10 @@ public class GLCapabilities implements Cloneable {
return backgroundOpaque;
}
- /** Returns a textual representation of this GLCapabilities
+ /** Returns a textual representation of this NWCapabilities
object. */
public String toString() {
- return ("GLCapabilities [" +
+ return ("NWCapabilities [" +
"DoubleBuffered: " + doubleBuffered +
", Stereo: " + stereo +
", HardwareAccelerated: " + hardwareAccelerated +
diff --git a/src/classes/javax/media/opengl/GLCapabilitiesChooser.java b/src/classes/javax/media/nwi/NWCapabilitiesChooser.java
index 9d970ff42..12884c5e2 100644
--- a/src/classes/javax/media/opengl/GLCapabilitiesChooser.java
+++ b/src/classes/javax/media/nwi/NWCapabilitiesChooser.java
@@ -37,17 +37,17 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
-package javax.media.opengl;
+package javax.media.nwi;
/** Provides a mechanism by which applications can customize the
- window type selection for a given {@link GLCapabilities}.
+ window type selection for a given {@link NWCapabilities}.
Developers can implement this interface and pass an instance into
the appropriate method of {@link GLDrawableFactory}; the chooser
will be called during the OpenGL context creation process. */
-public interface GLCapabilitiesChooser {
+public interface NWCapabilitiesChooser {
/** Chooses the index (0..available.length - 1) of the {@link
- GLCapabilities} most closely matching the desired one from the
+ NWCapabilities} most closely matching the desired one from the
list of all supported. Some of the entries in the
<code>available</code> array may be null; the chooser must
ignore these. The <em>windowSystemRecommendedChoice</em>
@@ -59,9 +59,9 @@ public interface GLCapabilitiesChooser {
{@link GLDrawableFactory} when an instance of this class is
passed in to one of its factory methods. It should generally not
be invoked by users directly, unless it is desired to delegate
- the choice to some other GLCapabilitiesChooser object.
+ the choice to some other NWCapabilitiesChooser object.
*/
- public int chooseCapabilities(GLCapabilities desired,
- GLCapabilities[] available,
+ public int chooseCapabilities(NWCapabilities desired,
+ NWCapabilities[] available,
int windowSystemRecommendedChoice);
}
diff --git a/src/classes/javax/media/opengl/NativeWindow.java b/src/classes/javax/media/nwi/NativeWindow.java
index f7e09520e..f992c2231 100644
--- a/src/classes/javax/media/opengl/NativeWindow.java
+++ b/src/classes/javax/media/nwi/NativeWindow.java
@@ -37,7 +37,7 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
-package javax.media.opengl;
+package javax.media.nwi;
/** Provides the mechanism by which the Java / OpenGL binding
interacts with windows. A window toolkit such as the AWT may
diff --git a/src/classes/javax/media/opengl/NativeWindowException.java b/src/classes/javax/media/nwi/NativeWindowException.java
index cb43d3830..bc1a8ddef 100644
--- a/src/classes/javax/media/opengl/NativeWindowException.java
+++ b/src/classes/javax/media/nwi/NativeWindowException.java
@@ -37,7 +37,7 @@
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
-package javax.media.opengl;
+package javax.media.nwi;
/** A generic exception for OpenGL errors used throughout the binding
as a substitute for {@link RuntimeException}. */
diff --git a/src/classes/javax/media/opengl/GLDrawable.java b/src/classes/javax/media/opengl/GLDrawable.java
index 50c95e688..c2bbcb860 100644
--- a/src/classes/javax/media/opengl/GLDrawable.java
+++ b/src/classes/javax/media/opengl/GLDrawable.java
@@ -39,6 +39,8 @@
package javax.media.opengl;
+import javax.media.nwi.*;
+
// FIXME: We need some way to tell when the device upon which the canvas is
// being displayed has changed (e.g., the user drags the canvas's parent
// window from one screen on multi-screen environment to another, when the
@@ -141,7 +143,7 @@ public interface GLDrawable {
automatically and should not be called by the end user. */
public void swapBuffers() throws GLException;
- /** Fetches the {@link GLCapabilities} corresponding to the chosen
+ /** Fetches the {@link NWCapabilities} corresponding to the chosen
OpenGL capabilities (pixel format / visual) for this drawable.
Some drawables, in particular on-screen drawables, may be
created lazily; null is returned if the drawable is not
@@ -151,7 +153,7 @@ public interface GLDrawable {
value in this case.
Returns a copy of the passed object.
*/
- public GLCapabilities getChosenGLCapabilities();
+ public NWCapabilities getChosenNWCapabilities();
public NativeWindow getNativeWindow();
diff --git a/src/classes/javax/media/opengl/GLDrawableFactory.java b/src/classes/javax/media/opengl/GLDrawableFactory.java
index dbbb42a0e..7ef8bdd58 100644
--- a/src/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/classes/javax/media/opengl/GLDrawableFactory.java
@@ -39,6 +39,8 @@
package javax.media.opengl;
+import javax.media.nwi.*;
+
import java.lang.reflect.*;
import java.security.*;
import com.sun.opengl.impl.*;
@@ -46,21 +48,21 @@ import com.sun.opengl.impl.*;
/** <P> Provides a virtual machine- and operating system-independent
mechanism for creating {@link GLDrawable}s. </P>
- <P> The {@link javax.media.opengl.GLCapabilities} objects passed
+ <P> The {@link javax.media.opengl.NWCapabilities} objects passed
in to the various factory methods are used as a hint for the
properties of the returned drawable. The default capabilities
selection algorithm (equivalent to passing in a null {@link
- GLCapabilitiesChooser}) is described in {@link
- DefaultGLCapabilitiesChooser}. Sophisticated applications needing
+ NWCapabilitiesChooser}) is described in {@link
+ DefaultNWCapabilitiesChooser}. Sophisticated applications needing
to change the selection algorithm may pass in their own {@link
- GLCapabilitiesChooser} which can select from the available pixel
- formats. The GLCapabilitiesChooser mechanism may not be supported
+ NWCapabilitiesChooser} which can select from the available pixel
+ formats. The NWCapabilitiesChooser mechanism may not be supported
by all implementations or on all platforms, in which case any
- passed GLCapabilitiesChooser will be ignored. </P>
+ passed NWCapabilitiesChooser will be ignored. </P>
<P> Because of the multithreaded nature of the Java platform's
Abstract Window Toolkit, it is typically not possible to immediately
- reject a given {@link GLCapabilities} as being unsupportable by
+ reject a given {@link NWCapabilities} as being unsupportable by
either returning <code>null</code> from the creation routines or
raising a {@link GLException}. The semantics of the rejection
process are (unfortunately) left unspecified for now. The current
@@ -153,19 +155,19 @@ public abstract class GLDrawableFactory {
* Returns a GLDrawable that wraps a platform-specific window system
* object, such as an AWT or LCDUI Canvas. On platforms which
* support it, selects a pixel format compatible with the supplied
- * GLCapabilities, or if the passed GLCapabilities object is null,
+ * NWCapabilities, or if the passed NWCapabilities object is null,
* uses a default set of capabilities. On these platforms, uses
- * either the supplied GLCapabilitiesChooser object, or if the
- * passed GLCapabilitiesChooser object is null, uses a
- * DefaultGLCapabilitiesChooser instance.
+ * either the supplied NWCapabilitiesChooser object, or if the
+ * passed NWCapabilitiesChooser object is null, uses a
+ * DefaultNWCapabilitiesChooser instance.
*
* @throws IllegalArgumentException if the passed target is null
* @throws GLException if any window system-specific errors caused
* the creation of the GLDrawable to fail.
*/
public abstract GLDrawable createGLDrawable(NativeWindow target,
- GLCapabilities capabilities,
- GLCapabilitiesChooser chooser)
+ NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser)
throws IllegalArgumentException, GLException;
//----------------------------------------------------------------------
@@ -186,8 +188,8 @@ public abstract class GLDrawableFactory {
* @throws GLException if any window system-specific errors caused
* the creation of the GLPbuffer to fail.
*/
- public abstract GLPbuffer createGLPbuffer(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public abstract GLPbuffer createGLPbuffer(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
int initialWidth,
int initialHeight,
GLContext shareWith)
diff --git a/src/classes/javax/media/opengl/GLPbuffer.java b/src/classes/javax/media/opengl/GLPbuffer.java
index 04cf7f0ed..0250365b0 100644
--- a/src/classes/javax/media/opengl/GLPbuffer.java
+++ b/src/classes/javax/media/opengl/GLPbuffer.java
@@ -59,7 +59,7 @@ public interface GLPbuffer extends GLAutoDrawable {
/** Binds this pbuffer to its internal texture target. Only valid to
call if offscreen render-to-texture has been specified in the
- GLCapabilities for this GLPbuffer. If the
+ NWCapabilities for this GLPbuffer. If the
render-to-texture-rectangle capability has also been specified,
this will use e.g. wglBindTexImageARB as its implementation and
cause the texture to be bound to e.g. the
@@ -82,7 +82,7 @@ public interface GLPbuffer extends GLAutoDrawable {
/** Indicates which vendor's extension is being used to support
floating point channels in this pbuffer if that capability was
- requested in the GLCapabilities during pbuffer creation. Returns
+ requested in the NWCapabilities during pbuffer creation. Returns
one of NV_FLOAT, ATI_FLOAT or APPLE_FLOAT, or throws GLException
if floating-point channels were not requested for this pbuffer.
This function may only be called once the init method for this
diff --git a/src/classes/javax/media/opengl/NativeWindowFactory.java b/src/classes/javax/media/opengl/NativeWindowFactory.java
index b80e239ea..c0009444a 100644
--- a/src/classes/javax/media/opengl/NativeWindowFactory.java
+++ b/src/classes/javax/media/opengl/NativeWindowFactory.java
@@ -32,6 +32,7 @@
package javax.media.opengl;
+import javax.media.nwi.*;
import java.lang.reflect.*;
import java.security.*;
import java.util.*;
@@ -68,7 +69,7 @@ public abstract class NativeWindowFactory {
// make it easier to run this code on mobile devices
NativeWindowFactory factory = new NativeWindowFactoryImpl();
- nativeWindowClass = javax.media.opengl.NativeWindow.class;
+ nativeWindowClass = javax.media.nwi.NativeWindow.class;
registerFactory(nativeWindowClass, factory);
defaultFactory = factory;
@@ -174,7 +175,7 @@ public abstract class NativeWindowFactory {
/**
* <P> Selects a graphics configuration on the specified graphics
- * device compatible with the supplied GLCapabilities. This method
+ * device compatible with the supplied NWCapabilities. This method
* is intended to be used by applications which do not use the
* supplied GLCanvas class but instead wrap their own Canvas or
* other window toolkit-specific object with a GLDrawable. Some
@@ -199,8 +200,8 @@ public abstract class NativeWindowFactory {
* the selection of the graphics configuration to fail.
*/
public abstract AbstractGraphicsConfiguration
- chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice device)
throws IllegalArgumentException, GLException;
diff --git a/src/classes/javax/media/opengl/X11GraphicsConfiguration.java b/src/classes/javax/media/opengl/X11GraphicsConfiguration.java
index 95127f2c1..b7784558d 100644
--- a/src/classes/javax/media/opengl/X11GraphicsConfiguration.java
+++ b/src/classes/javax/media/opengl/X11GraphicsConfiguration.java
@@ -32,6 +32,8 @@
package javax.media.opengl;
+import javax.media.nwi.*;
+
/** Encapsulates a graphics configuration, or OpenGL pixel format, on
X11 platforms. Objects of this type are returned from {@link
NativeWindowFactory#chooseGraphicsConfiguration
diff --git a/src/classes/javax/media/opengl/X11GraphicsDevice.java b/src/classes/javax/media/opengl/X11GraphicsDevice.java
index 1a8900f31..31002f1d4 100644
--- a/src/classes/javax/media/opengl/X11GraphicsDevice.java
+++ b/src/classes/javax/media/opengl/X11GraphicsDevice.java
@@ -32,6 +32,8 @@
package javax.media.opengl;
+import javax.media.nwi.*;
+
/** Encapsulates a graphics device, or screen, on X11
platforms. Objects of this type are passed to {@link
NativeWindowFactory#chooseGraphicsConfiguration
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() {