aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/opengl/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun/opengl/impl')
-rw-r--r--src/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java5
-rw-r--r--src/classes/com/sun/opengl/impl/GLDrawableImpl.java21
-rw-r--r--src/classes/com/sun/opengl/impl/GLPbufferImpl.java5
-rw-r--r--src/classes/com/sun/opengl/impl/NativeWindowFactoryImpl.java5
-rw-r--r--src/classes/com/sun/opengl/impl/NullWindow.java1
-rw-r--r--src/classes/com/sun/opengl/impl/egl/EGLConfig.java13
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/egl/EGLContext.java1
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/egl/EGLDrawable.java11
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java17
-rw-r--r--src/classes/com/sun/opengl/impl/jawt/JAWTWindow.java1
-rw-r--r--src/classes/com/sun/opengl/impl/jawt/macosx/MacOSXJAWTWindow.java1
-rw-r--r--src/classes/com/sun/opengl/impl/jawt/windows/WindowsJAWTWindow.java1
-rw-r--r--src/classes/com/sun/opengl/impl/jawt/x11/X11JAWTWindow.java1
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java13
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java13
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java21
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java3
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java1
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java5
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java9
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java5
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java5
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java3
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java9
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java1
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java5
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java7
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java13
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java1
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java63
-rw-r--r--src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java21
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java1
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java1
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java1
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java19
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java39
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXNativeWindowFactory.java25
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java9
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java5
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java7
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java1
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java9
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11Util.java1
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXNativeWindowFactory.java5
44 files changed, 224 insertions, 180 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java b/src/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java
index 70aef0dc3..d3906c08f 100644
--- a/src/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLDrawableFactoryImpl.java
@@ -40,6 +40,7 @@
package com.sun.opengl.impl;
import java.nio.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.gluegen.runtime.*;
@@ -52,8 +53,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory implements
/** Creates a (typically software-accelerated) offscreen GLDrawable
used to implement the fallback rendering path of the
GLJPanel. */
- public abstract GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public abstract GLDrawableImpl createOffscreenDrawable(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
int width,
int height);
diff --git a/src/classes/com/sun/opengl/impl/GLDrawableImpl.java b/src/classes/com/sun/opengl/impl/GLDrawableImpl.java
index 0818ac1c4..46c79cf2b 100644
--- a/src/classes/com/sun/opengl/impl/GLDrawableImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLDrawableImpl.java
@@ -39,19 +39,20 @@
package com.sun.opengl.impl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
public abstract class GLDrawableImpl implements GLDrawable {
- private GLCapabilities requestedCapabilities;
+ private NWCapabilities requestedCapabilities;
protected GLDrawableImpl(GLDrawableFactory factory,
NativeWindow comp,
- GLCapabilities requestedCapabilities,
+ NWCapabilities requestedCapabilities,
boolean realized) {
this.factory = factory;
this.component = comp;
this.requestedCapabilities =
- (requestedCapabilities == null) ? null : (GLCapabilities) requestedCapabilities.clone();
+ (requestedCapabilities == null) ? null : (NWCapabilities) requestedCapabilities.clone();
this.realized = realized;
}
@@ -72,20 +73,20 @@ public abstract class GLDrawableImpl implements GLDrawable {
return GLContextImpl.toHexString(hex);
}
- protected GLCapabilities getRequestedGLCapabilities() {
+ protected NWCapabilities getRequestedNWCapabilities() {
return requestedCapabilities;
}
- public GLCapabilities getChosenGLCapabilities() {
+ public NWCapabilities getChosenNWCapabilities() {
if (chosenCapabilities == null)
return null;
// Must return a new copy to avoid mutation by end user
- return (GLCapabilities) chosenCapabilities.clone();
+ return (NWCapabilities) chosenCapabilities.clone();
}
- protected void setChosenGLCapabilities(GLCapabilities caps) {
- chosenCapabilities = (caps==null) ? null : (GLCapabilities) caps.clone();
+ protected void setChosenNWCapabilities(NWCapabilities caps) {
+ chosenCapabilities = (caps==null) ? null : (NWCapabilities) caps.clone();
}
public NativeWindow getNativeWindow() {
@@ -99,7 +100,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
public void setRealized(boolean realized) {
this.realized = realized;
if(!realized) {
- setChosenGLCapabilities(null);
+ setChosenNWCapabilities(null);
component.invalidate();
}
}
@@ -140,7 +141,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
protected GLDrawableFactory factory;
protected NativeWindow component;
- private GLCapabilities chosenCapabilities;
+ private NWCapabilities chosenCapabilities;
// Indicates whether the component (if an onscreen context) has been
// realized. Plausibly, before the component is realized the JAWT
diff --git a/src/classes/com/sun/opengl/impl/GLPbufferImpl.java b/src/classes/com/sun/opengl/impl/GLPbufferImpl.java
index 14c218c45..548991365 100644
--- a/src/classes/com/sun/opengl/impl/GLPbufferImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLPbufferImpl.java
@@ -46,6 +46,7 @@ import java.awt.event.*;
import java.beans.PropertyChangeListener;
*/
+import javax.media.nwi.*;
import javax.media.opengl.*;
/** Platform-independent class exposing pbuffer functionality to
@@ -156,11 +157,11 @@ public class GLPbufferImpl implements GLPbuffer {
context.releasePbufferFromTexture();
}
- public GLCapabilities getChosenGLCapabilities() {
+ public NWCapabilities getChosenNWCapabilities() {
if (pbufferDrawable == null)
return null;
- return pbufferDrawable.getChosenGLCapabilities();
+ return pbufferDrawable.getChosenNWCapabilities();
}
private boolean surfaceLocked = false;
diff --git a/src/classes/com/sun/opengl/impl/NativeWindowFactoryImpl.java b/src/classes/com/sun/opengl/impl/NativeWindowFactoryImpl.java
index 296ea3a44..c5e5230e4 100644
--- a/src/classes/com/sun/opengl/impl/NativeWindowFactoryImpl.java
+++ b/src/classes/com/sun/opengl/impl/NativeWindowFactoryImpl.java
@@ -35,6 +35,7 @@ package com.sun.opengl.impl;
import java.lang.reflect.*;
import java.security.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
public class NativeWindowFactoryImpl extends NativeWindowFactory {
@@ -100,8 +101,8 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
// All platforms except for X11 perform the OpenGL pixel format
// selection lazily
- public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice device) {
return null;
}
diff --git a/src/classes/com/sun/opengl/impl/NullWindow.java b/src/classes/com/sun/opengl/impl/NullWindow.java
index 1cd4b4bc2..02a252370 100644
--- a/src/classes/com/sun/opengl/impl/NullWindow.java
+++ b/src/classes/com/sun/opengl/impl/NullWindow.java
@@ -36,6 +36,7 @@
package com.sun.opengl.impl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
public class NullWindow implements NativeWindow {
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLConfig.java b/src/classes/com/sun/opengl/impl/egl/EGLConfig.java
index 4948b3a0c..2c03a20a6 100644
--- a/src/classes/com/sun/opengl/impl/egl/EGLConfig.java
+++ b/src/classes/com/sun/opengl/impl/egl/EGLConfig.java
@@ -36,6 +36,7 @@
package com.sun.opengl.impl.egl;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.gluegen.runtime.NativeLibrary;
@@ -50,7 +51,7 @@ public class EGLConfig {
return configID;
}
- public GLCapabilities getCapabilities() {
+ public NWCapabilities getCapabilities() {
return capabilities;
}
@@ -82,11 +83,11 @@ public class EGLConfig {
if (numConfigs[0] == 0) {
throw new GLException("No valid graphics configuration selected from eglChooseConfig");
}
- capabilities = new GLCapabilities();
+ capabilities = new NWCapabilities();
setup(display, configID, configs[0]);
}
- public EGLConfig(long display, GLCapabilities caps) {
+ public EGLConfig(long display, NWCapabilities caps) {
int[] attrs = glCapabilities2AttribList(caps);
_EGLConfig[] configs = new _EGLConfig[1];
int[] numConfigs = new int[1];
@@ -99,7 +100,7 @@ public class EGLConfig {
if (numConfigs[0] == 0) {
throw new GLException("No valid graphics configuration selected from eglChooseConfig");
}
- capabilities = (GLCapabilities)caps.clone();
+ capabilities = (NWCapabilities)caps.clone();
setup(display, -1, configs[0]);
}
@@ -136,7 +137,7 @@ public class EGLConfig {
}
}
- public static int[] glCapabilities2AttribList(GLCapabilities caps) {
+ public static int[] glCapabilities2AttribList(NWCapabilities caps) {
int[] attrs = new int[] {
EGL.EGL_RENDERABLE_TYPE, -1,
// FIXME: does this need to be configurable?
@@ -166,6 +167,6 @@ public class EGLConfig {
}
private _EGLConfig _config;
private int configID;
- private GLCapabilities capabilities;
+ private NWCapabilities capabilities;
}
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLContext.java b/src/classes/com/sun/opengl/impl/egl/EGLContext.java
index df3bd2a34..b7cfb051e 100755
--- a/src/classes/com/sun/opengl/impl/egl/EGLContext.java
+++ b/src/classes/com/sun/opengl/impl/egl/EGLContext.java
@@ -35,6 +35,7 @@
package com.sun.opengl.impl.egl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.gluegen.runtime.ProcAddressTable;
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
index 215c6ed28..3e7df000c 100755
--- a/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawable.java
@@ -38,10 +38,11 @@ package com.sun.opengl.impl.egl;
import com.sun.opengl.impl.GLDrawableImpl;
import com.sun.opengl.impl.GLReflection;
+import javax.media.nwi.*;
import javax.media.opengl.*;
public class EGLDrawable extends GLDrawableImpl {
- private GLCapabilitiesChooser chooser;
+ private NWCapabilitiesChooser chooser;
private long display;
private EGLConfig config;
private long surface;
@@ -49,8 +50,8 @@ public class EGLDrawable extends GLDrawableImpl {
public EGLDrawable(EGLDrawableFactory factory,
NativeWindow component,
- GLCapabilities requestedCapabilities,
- GLCapabilitiesChooser chooser) throws GLException {
+ NWCapabilities requestedCapabilities,
+ NWCapabilitiesChooser chooser) throws GLException {
super(factory, component, requestedCapabilities, false);
this.chooser = chooser;
surface=EGL.EGL_NO_SURFACE;
@@ -114,9 +115,9 @@ public class EGLDrawable extends GLDrawableImpl {
if (!EGL.eglInitialize(display, null, null)) {
throw new GLException("eglInitialize failed");
}
- config = new EGLConfig(display, getRequestedGLCapabilities());
+ config = new EGLConfig(display, getRequestedNWCapabilities());
}
- setChosenGLCapabilities(config.getCapabilities());
+ setChosenNWCapabilities(config.getCapabilities());
} else if (surface != EGL.EGL_NO_SURFACE) {
// Destroy the window surface
if (!EGL.eglDestroySurface(display, surface)) {
diff --git a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
index 37dd6c8fe..6fc009752 100755
--- a/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
@@ -36,6 +36,7 @@
package com.sun.opengl.impl.egl;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.gluegen.runtime.NativeLibrary;
@@ -116,23 +117,23 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
}
}
- public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice device) {
return null;
}
public GLDrawable createGLDrawable(NativeWindow target,
- GLCapabilities capabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser) {
target = NativeWindowFactory.getNativeWindow(target);
return new EGLDrawable(this, target,
capabilities,
chooser);
}
- public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public GLDrawableImpl createOffscreenDrawable(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
int width,
int height) {
throw new GLUnsupportedException("Not yet implemented");
@@ -142,8 +143,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
// Not supported on OpenGL ES
return false;
}
- public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
- final GLCapabilitiesChooser chooser,
+ public GLPbuffer createGLPbuffer(final NWCapabilities capabilities,
+ final NWCapabilitiesChooser chooser,
final int initialWidth,
final int initialHeight,
final GLContext shareWith) {
diff --git a/src/classes/com/sun/opengl/impl/jawt/JAWTWindow.java b/src/classes/com/sun/opengl/impl/jawt/JAWTWindow.java
index b1a1d9d8e..ebbb7f666 100644
--- a/src/classes/com/sun/opengl/impl/jawt/JAWTWindow.java
+++ b/src/classes/com/sun/opengl/impl/jawt/JAWTWindow.java
@@ -40,6 +40,7 @@ import com.sun.opengl.impl.*;
import java.awt.Component;
import java.awt.GraphicsEnvironment;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
diff --git a/src/classes/com/sun/opengl/impl/jawt/macosx/MacOSXJAWTWindow.java b/src/classes/com/sun/opengl/impl/jawt/macosx/MacOSXJAWTWindow.java
index 3646e045f..55c4490db 100644
--- a/src/classes/com/sun/opengl/impl/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/classes/com/sun/opengl/impl/jawt/macosx/MacOSXJAWTWindow.java
@@ -46,6 +46,7 @@ import com.sun.opengl.impl.*;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import java.security.*;
diff --git a/src/classes/com/sun/opengl/impl/jawt/windows/WindowsJAWTWindow.java b/src/classes/com/sun/opengl/impl/jawt/windows/WindowsJAWTWindow.java
index 2eddabe76..61da71bea 100644
--- a/src/classes/com/sun/opengl/impl/jawt/windows/WindowsJAWTWindow.java
+++ b/src/classes/com/sun/opengl/impl/jawt/windows/WindowsJAWTWindow.java
@@ -42,6 +42,7 @@ package com.sun.opengl.impl.jawt.windows;
import com.sun.opengl.impl.windows.*;
import com.sun.opengl.impl.jawt.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
diff --git a/src/classes/com/sun/opengl/impl/jawt/x11/X11JAWTWindow.java b/src/classes/com/sun/opengl/impl/jawt/x11/X11JAWTWindow.java
index 4e22babee..d3039844f 100644
--- a/src/classes/com/sun/opengl/impl/jawt/x11/X11JAWTWindow.java
+++ b/src/classes/com/sun/opengl/impl/jawt/x11/X11JAWTWindow.java
@@ -40,6 +40,7 @@ import com.sun.opengl.impl.x11.*;
import com.sun.opengl.impl.jawt.*;
import com.sun.opengl.impl.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import java.awt.GraphicsDevice;
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
index 5c1a05e6b..a245b267a 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl.macosx.cgl;
import java.nio.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.gluegen.runtime.ProcAddressTable;
@@ -110,7 +111,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl
}
}
int[] viewNotReady = new int[1];
- GLCapabilities capabilities = drawable.getRequestedGLCapabilities();
+ NWCapabilities capabilities = drawable.getRequestedNWCapabilities();
int[] iattribs = new int[128];
int[] ivalues = new int[128];
int idx = 0;
@@ -139,7 +140,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl
long pixelFormat = CGL.createPixelFormat(iattribs, 0, idx, ivalues, 0);
if (pixelFormat == 0) {
- throw new GLException("Unable to allocate pixel format with requested GLCapabilities");
+ throw new GLException("Unable to allocate pixel format with requested NWCapabilities");
}
try {
// Try to allocate a context with this
@@ -167,10 +168,10 @@ public abstract class MacOSXCGLContext extends GLContextImpl
// context and not the drawable. However it's a reasonable
// approximation to just store the chosen pixel format up in the
// drawable since the public API doesn't provide for a different
- // GLCapabilities per context.
- if (drawable.getChosenGLCapabilities() == null) {
+ // NWCapabilities per context.
+ if (drawable.getChosenNWCapabilities() == null) {
// Figure out what attributes we really got
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
CGL.queryPixelFormat(pixelFormat, iattribs, 0, idx, ivalues, 0);
for (int i = 0; i < idx; i++) {
int attr = iattribs[i];
@@ -234,7 +235,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl
}
}
- drawable.setChosenGLCapabilities(caps);
+ drawable.setChosenNWCapabilities(caps);
}
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
index efce08706..01816b190 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawable.java
@@ -39,13 +39,14 @@
package com.sun.opengl.impl.macosx.cgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
protected static final boolean DEBUG = Debug.debug("MacOSXCGLDrawable");
- protected GLCapabilitiesChooser chooser;
+ protected NWCapabilitiesChooser chooser;
// The Java2D/OpenGL pipeline on OS X uses low-level CGLContextObjs
// to represent the contexts for e.g. the Java2D back buffer. When
@@ -81,18 +82,18 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
public static final int CGL_MODE = 2;
public MacOSXCGLDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized,
- GLCapabilities requestedCapabilities, GLCapabilitiesChooser chooser) {
+ NWCapabilities requestedCapabilities, NWCapabilitiesChooser chooser) {
super(factory, comp, requestedCapabilities, realized);
this.chooser = chooser;
}
// These are public to allow access from a couple of context implementations
- public void setChosenGLCapabilities(GLCapabilities caps) {
- super.setChosenGLCapabilities(caps);
+ public void setChosenNWCapabilities(NWCapabilities caps) {
+ super.setChosenNWCapabilities(caps);
}
- public GLCapabilities getRequestedGLCapabilities() {
- return super.getRequestedGLCapabilities();
+ public NWCapabilities getRequestedNWCapabilities() {
+ return super.getRequestedNWCapabilities();
}
protected static String getThreadName() {
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
index 3352a137c..22b7f368b 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -42,6 +42,7 @@ package com.sun.opengl.impl.macosx.cgl;
import java.lang.reflect.InvocationTargetException;
import java.nio.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -50,30 +51,30 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
super();
}
- public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice device) {
return null;
}
public GLDrawable createGLDrawable(NativeWindow target,
- GLCapabilities capabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
target = NativeWindowFactory.getNativeWindow(target);
if (capabilities == null) {
- capabilities = new GLCapabilities();
+ capabilities = new NWCapabilities();
}
if (chooser == null) {
- chooser = new DefaultGLCapabilitiesChooser();
+ chooser = new DefaultNWCapabilitiesChooser();
}
return new MacOSXOnscreenCGLDrawable(this, target, capabilities, chooser);
}
- public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public GLDrawableImpl createOffscreenDrawable(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
int width,
int height) {
return new MacOSXOffscreenCGLDrawable(this, capabilities, width, height);
@@ -83,8 +84,8 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
return true;
}
- public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
- final GLCapabilitiesChooser chooser,
+ public GLPbuffer createGLPbuffer(final NWCapabilities capabilities,
+ final NWCapabilitiesChooser chooser,
final int initialWidth,
final int initialHeight,
final GLContext shareWith) {
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
index a825e1c1e..aaaf38277 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
@@ -39,13 +39,14 @@
package com.sun.opengl.impl.macosx.cgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable {
public MacOSXOffscreenCGLDrawable(GLDrawableFactory factory,
- GLCapabilities capabilities,
+ NWCapabilities capabilities,
int width,
int height) {
super(factory, capabilities, width, height);
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java
index 1165e759d..0767f40ee 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLContext.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl.macosx.cgl;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
index 6a42700f3..e17eee602 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
@@ -43,6 +43,7 @@ import java.lang.ref.WeakReference;
import java.security.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -51,8 +52,8 @@ public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable {
new ArrayList();
protected MacOSXOnscreenCGLDrawable(GLDrawableFactory factory, NativeWindow component,
- GLCapabilities capabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser) {
super(factory, component, false, capabilities, chooser);
}
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
index b128cfcbe..f927731eb 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLContext.java
@@ -3,6 +3,7 @@ package com.sun.opengl.impl.macosx.cgl;
import java.security.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -80,7 +81,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
// Initialize render-to-texture support if requested
GL gl = getGL();
- boolean rect = gl.isGL2() && drawable.getRequestedGLCapabilities().getPbufferRenderToTextureRectangle();
+ boolean rect = gl.isGL2() && drawable.getRequestedNWCapabilities().getPbufferRenderToTextureRectangle();
if (rect) {
if (!gl.isExtensionAvailable("GL_EXT_texture_rectangle")) {
System.err.println("MacOSXPbufferCGLContext: WARNING: GL_EXT_texture_rectangle extension not " +
@@ -135,7 +136,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
}
protected boolean create() {
- GLCapabilities capabilities = drawable.getRequestedGLCapabilities();
+ NWCapabilities capabilities = drawable.getRequestedNWCapabilities();
if (capabilities.getPbufferFloatingPointBuffers() &&
!isTigerOrLater) {
throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
@@ -210,7 +211,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
// NSOpenGLContext-based implementation
class NSOpenGLImpl implements Impl {
public long create() {
- GLCapabilities capabilities = drawable.getRequestedGLCapabilities();
+ NWCapabilities capabilities = drawable.getRequestedNWCapabilities();
if (capabilities.getPbufferFloatingPointBuffers() &&
!isTigerOrLater) {
throw new GLException("Floating-point pbuffers supported only on OS X 10.4 or later");
@@ -265,7 +266,7 @@ public class MacOSXPbufferCGLContext extends MacOSXCGLContext {
int[] attrs = new int[256];
int i = 0;
attrs[i++] = CGL.kCGLPFAPBuffer;
- GLCapabilities capabilities = drawable.getRequestedGLCapabilities();
+ NWCapabilities capabilities = drawable.getRequestedNWCapabilities();
if (capabilities.getPbufferFloatingPointBuffers())
attrs[i++] = CGL.kCGLPFAColorFloat;
if (capabilities.getDoubleBuffered())
diff --git a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index 067e9d903..b7384798f 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.macosx.cgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -55,7 +56,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
// semantic is that contains an NSView
protected long pBuffer;
- public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, GLCapabilities capabilities, int width, int height) {
+ public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, NWCapabilities capabilities, int width, int height) {
super(factory, new NullWindow(), true, capabilities, null);
NullWindow nw = (NullWindow) getNativeWindow();
nw.setSize(width, height);
@@ -88,7 +89,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
private void createPbuffer() {
NullWindow nw = (NullWindow) getNativeWindow();
int renderTarget;
- GLCapabilities capabilities = getRequestedGLCapabilities();
+ NWCapabilities capabilities = getRequestedNWCapabilities();
if (GLProfile.isGL2() && capabilities.getPbufferRenderToTextureRectangle()) {
renderTarget = GL2.GL_TEXTURE_RECTANGLE;
} else {
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
index 85447f00b..888e70ac1 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.windows.wgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -46,7 +47,7 @@ public class WindowsDummyWGLDrawable extends WindowsWGLDrawable {
private long hwnd, hdc;
public WindowsDummyWGLDrawable(GLDrawableFactory factory) {
- super(factory, new NullWindow(), true, new GLCapabilities(), null);
+ super(factory, new NullWindow(), true, new NWCapabilities(), null);
// All entries to CreateDummyWindow must synchronize on one object
// to avoid accidentally registering the dummy window class twice
synchronized (WindowsDummyWGLDrawable.class) {
@@ -56,7 +57,7 @@ public class WindowsDummyWGLDrawable extends WindowsWGLDrawable {
NullWindow nw = (NullWindow) getNativeWindow();
nw.setSurfaceHandle(hdc);
// Choose a (hopefully hardware-accelerated) OpenGL pixel format for this device context
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
caps.setDepthBits(16);
PIXELFORMATDESCRIPTOR pfd = glCapabilities2PFD(caps, true);
int pixelFormat = WGL.ChoosePixelFormat(hdc, pfd);
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java
index 826acc613..0514e1aec 100755
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsExternalWGLDrawable.java
@@ -39,13 +39,14 @@
package com.sun.opengl.impl.windows.wgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
public WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeWindow component) {
- super(factory, component, true, new GLCapabilities(), null);
+ super(factory, component, true, new NWCapabilities(), null);
}
public static WindowsExternalWGLDrawable create(GLDrawableFactory factory) {
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
index 03b52be9f..97041ff06 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.windows.wgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -47,8 +48,8 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable {
private long hbitmap;
public WindowsOffscreenWGLDrawable(GLDrawableFactory factory,
- GLCapabilities requestedCapabilities,
- GLCapabilitiesChooser chooser,
+ NWCapabilities requestedCapabilities,
+ NWCapabilitiesChooser chooser,
int width,
int height) {
super(factory, new NullWindow(), true, requestedCapabilities, chooser);
@@ -62,7 +63,7 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable {
private void create() {
NullWindow nw = (NullWindow) getNativeWindow();
- GLCapabilities capabilities = getRequestedGLCapabilities();
+ NWCapabilities capabilities = getRequestedNWCapabilities();
int width = getWidth();
int height = getHeight();
BITMAPINFO info = BITMAPINFO.create();
@@ -120,7 +121,7 @@ public class WindowsOffscreenWGLDrawable extends WindowsWGLDrawable {
origbitmap = 0;
hbitmap = 0;
nw.setSurfaceHandle(0);
- setChosenGLCapabilities(null);
+ setChosenNWCapabilities(null);
}
}
}
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java
index 02459f590..7eb96c7dc 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLContext.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl.windows.wgl;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
index 52812f0e9..7c3cea255 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsOnscreenWGLDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.windows.wgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -53,8 +54,8 @@ public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
private long profilingSwapBuffersTime;
protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeWindow component,
- GLCapabilities capabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser) {
super(factory, component, false, capabilities, chooser);
}
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
index ac3a5d5c8..e975670b4 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLContext.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.windows.wgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -62,7 +63,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext {
public void bindPbufferToTexture() {
if (!rtt) {
throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
- "specified in its GLCapabilities");
+ "specified in its NWCapabilities");
}
GL gl = getGL();
WGLExt wglExt = getWGLExt();
@@ -80,7 +81,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext {
public void releasePbufferFromTexture() {
if (!rtt) {
throw new GLException("Shouldn't try to bind a pbuffer to a texture if render-to-texture hasn't been " +
- "specified in its GLCapabilities");
+ "specified in its NWCapabilities");
}
if (rtt && hasRTT) {
WGLExt wglExt = getWGLExt();
@@ -96,7 +97,7 @@ public class WindowsPbufferWGLContext extends WindowsWGLContext {
System.err.println("WindowsPbufferWGLContext: super.makeCurrentImpl() = " + res);
}
if (res == CONTEXT_CURRENT_NEW) {
- GLCapabilities capabilities = drawable.getRequestedGLCapabilities();
+ NWCapabilities capabilities = drawable.getRequestedNWCapabilities();
// Initialize render-to-texture support if requested
GL gl = getGL();
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
index 076031093..74e7c1a85 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.windows.wgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -51,7 +52,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
private int floatMode;
public WindowsPbufferWGLDrawable(GLDrawableFactory factory,
- GLCapabilities requestedCapabilities,
+ NWCapabilities requestedCapabilities,
int width,
int height,
WindowsWGLDrawable dummyDrawable,
@@ -94,7 +95,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
throw new GLException("Error destroying pbuffer: error code " + WGL.GetLastError());
}
buffer = 0;
- setChosenGLCapabilities(null);
+ setChosenNWCapabilities(null);
}
}
@@ -124,8 +125,8 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
}
// This is public to allow access from PbufferContext
- public GLCapabilities getRequestedGLCapabilities() {
- return super.getRequestedGLCapabilities();
+ public NWCapabilities getRequestedNWCapabilities() {
+ return super.getRequestedNWCapabilities();
}
private void createPbuffer(long parentHdc, WGLExt wglExt) {
@@ -135,7 +136,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
int niattribs = 0;
int width, height;
- GLCapabilities capabilities = getRequestedGLCapabilities();
+ NWCapabilities capabilities = getRequestedNWCapabilities();
if (DEBUG) {
System.out.println("Pbuffer parentHdc = " + toHexString(parentHdc));
@@ -307,7 +308,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
int[] ivalues = new int[niattribs];
// FIXME: usually prefer to throw exceptions, but failure here is not critical
if (wglExt.wglGetPixelFormatAttribiv(parentHdc, pformats[whichFormat], 0, niattribs, iattributes, 0, ivalues, 0)) {
- setChosenGLCapabilities(iattributes2GLCapabilities(iattributes, niattribs, ivalues, false));
+ setChosenNWCapabilities(iattributes2NWCapabilities(iattributes, niattribs, ivalues, false));
}
}
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java
index a02634a26..1ce190da3 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLContext.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl.windows.wgl;
import java.nio.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.gluegen.runtime.ProcAddressTable;
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
index c8965e0db..430270e37 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawable.java
@@ -39,13 +39,14 @@
package com.sun.opengl.impl.windows.wgl;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
public abstract class WindowsWGLDrawable extends GLDrawableImpl {
protected static final boolean DEBUG = Debug.debug("WindowsWGLDrawable");
- protected GLCapabilitiesChooser chooser;
+ protected NWCapabilitiesChooser chooser;
protected boolean pixelFormatChosen;
// Workaround for problems on Intel 82855 cards
@@ -56,8 +57,8 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
protected static final int MAX_ATTRIBS = 256;
public WindowsWGLDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized,
- GLCapabilities requestedCapabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities requestedCapabilities,
+ NWCapabilitiesChooser chooser) {
super(factory, comp, requestedCapabilities, realized);
this.chooser = chooser;
}
@@ -89,7 +90,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
}
return NativeWindow.LOCK_SURFACE_NOT_READY;
} else {
- // Probably a user error in the GLCapabilitiesChooser or similar.
+ // Probably a user error in the NWCapabilitiesChooser or similar.
// Don't propagate non-GLExceptions out because calling code
// expects to catch only that exception type
throw new GLException(e);
@@ -103,8 +104,8 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
protected void choosePixelFormat(boolean onscreen) {
PIXELFORMATDESCRIPTOR pfd = null;
int pixelFormat = 0;
- GLCapabilities chosenCaps = null;
- GLCapabilities capabilities = getRequestedGLCapabilities();
+ NWCapabilities chosenCaps = null;
+ NWCapabilities capabilities = getRequestedNWCapabilities();
long hdc = getNativeWindow().getSurfaceHandle();
if (onscreen) {
if ((pixelFormat = WGL.GetPixelFormat(hdc)) != 0) {
@@ -120,15 +121,15 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
throw new GLException("Unable to describe pixel format " + pixelFormat +
" of window set by Java2D/OpenGL pipeline");
}
- setChosenGLCapabilities(pfd2GLCapabilities(pfd));
+ setChosenNWCapabilities(pfd2NWCapabilities(pfd));
pixelFormatChosen = true;
return;
}
- GLCapabilities[] availableCaps = null;
+ NWCapabilities[] availableCaps = null;
int numFormats = 0;
pfd = newPixelFormatDescriptor();
- // Produce a recommended pixel format selection for the GLCapabilitiesChooser.
+ // Produce a recommended pixel format selection for the NWCapabilitiesChooser.
// Use wglChoosePixelFormatARB if user requested multisampling and if we have it available
WindowsWGLDrawable dummyDrawable = null;
GLContextImpl dummyContext = null;
@@ -186,17 +187,17 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
if (recommendedPixelFormat < 0) {
System.err.print(getThreadName() + ": wglChoosePixelFormatARB didn't recommend a pixel format");
if (capabilities.getSampleBuffers()) {
- System.err.print(" for multisampled GLCapabilities");
+ System.err.print(" for multisampled NWCapabilities");
}
System.err.println();
}
}
- // Produce a list of GLCapabilities to give to the
- // GLCapabilitiesChooser.
+ // Produce a list of NWCapabilities to give to the
+ // NWCapabilitiesChooser.
// Use wglGetPixelFormatAttribivARB instead of
// DescribePixelFormat to get higher-precision information
- // about the pixel format (should make the GLCapabilities
+ // about the pixel format (should make the NWCapabilities
// more precise as well...i.e., remove the
// "HardwareAccelerated" bit, which is basically
// meaningless, and put in whether it can render to a
@@ -212,7 +213,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
// Should we be filtering out the pixel formats which aren't
// applicable, as we are doing here?
- // We don't have enough information in the GLCapabilities to
+ // We don't have enough information in the NWCapabilities to
// represent those that aren't...
iattributes[niattribs++] = WGLExt.WGL_DRAW_TO_WINDOW;
iattributes[niattribs++] = WGLExt.WGL_ACCELERATION;
@@ -235,12 +236,12 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
iattributes[niattribs++] = WGLExt.WGL_SAMPLES;
}
- availableCaps = new GLCapabilities[numFormats];
+ availableCaps = new NWCapabilities[numFormats];
for (int i = 0; i < numFormats; i++) {
if (!dummyWGLExt.wglGetPixelFormatAttribiv(hdc, i+1, 0, niattribs, iattributes, 0, iresults, 0)) {
throw new GLException("Error getting pixel format attributes for pixel format " + (i + 1) + " of device context");
}
- availableCaps[i] = iattributes2GLCapabilities(iattributes, niattribs, iresults, true);
+ availableCaps[i] = iattributes2NWCapabilities(iattributes, niattribs, iresults, true);
}
gotAvailableCaps = true;
} else {
@@ -278,19 +279,19 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
numFormats = WGL.DescribePixelFormat(hdc, 1, 0, null);
if (numFormats == 0) {
throw new GLException("Unable to enumerate pixel formats of window " +
- toHexString(hdc) + " for GLCapabilitiesChooser");
+ toHexString(hdc) + " for NWCapabilitiesChooser");
}
- availableCaps = new GLCapabilities[numFormats];
+ availableCaps = new NWCapabilities[numFormats];
for (int i = 0; i < numFormats; i++) {
if (WGL.DescribePixelFormat(hdc, 1 + i, pfd.size(), pfd) == 0) {
throw new GLException("Error describing pixel format " + (1 + i) + " of device context");
}
- availableCaps[i] = pfd2GLCapabilities(pfd);
+ availableCaps[i] = pfd2NWCapabilities(pfd);
}
}
// NOTE: officially, should make a copy of all of these
- // GLCapabilities to avoid mutation by the end user during the
+ // NWCapabilities to avoid mutation by the end user during the
// chooseCapabilities call, but for the time being, assume they
// won't be changed
@@ -298,7 +299,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
pixelFormat = chooser.chooseCapabilities(capabilities, availableCaps, recommendedPixelFormat);
if ((pixelFormat < 0) || (pixelFormat >= numFormats)) {
throw new GLException("Invalid result " + pixelFormat +
- " from GLCapabilitiesChooser (should be between 0 and " +
+ " from NWCapabilitiesChooser (should be between 0 and " +
(numFormats - 1) + ")");
}
if (DEBUG) {
@@ -326,19 +327,19 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
}
throw new GLException("Unable to set pixel format " + pixelFormat + " for device context " + toHexString(hdc) + ": error code " + lastError);
}
- // Reuse the previously-constructed GLCapabilities because it
+ // Reuse the previously-constructed NWCapabilities because it
// turns out that using DescribePixelFormat on some pixel formats
// (which, for example, support full-scene antialiasing) for some
// reason return that they are not OpenGL-capable
if (chosenCaps != null) {
- setChosenGLCapabilities(chosenCaps);
+ setChosenNWCapabilities(chosenCaps);
} else {
- setChosenGLCapabilities(pfd2GLCapabilities(pfd));
+ setChosenNWCapabilities(pfd2NWCapabilities(pfd));
}
pixelFormatChosen = true;
}
- protected static PIXELFORMATDESCRIPTOR glCapabilities2PFD(GLCapabilities caps, boolean onscreen) {
+ protected static PIXELFORMATDESCRIPTOR glCapabilities2PFD(NWCapabilities caps, boolean onscreen) {
int colorDepth = (caps.getRedBits() +
caps.getGreenBits() +
caps.getBlueBits());
@@ -387,11 +388,11 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
return pfd;
}
- protected static GLCapabilities pfd2GLCapabilities(PIXELFORMATDESCRIPTOR pfd) {
+ protected static NWCapabilities pfd2NWCapabilities(PIXELFORMATDESCRIPTOR pfd) {
if ((pfd.dwFlags() & WGL.PFD_SUPPORT_OPENGL) == 0) {
return null;
}
- GLCapabilities res = new GLCapabilities();
+ NWCapabilities res = new NWCapabilities();
res.setRedBits (pfd.cRedBits());
res.setGreenBits (pfd.cGreenBits());
res.setBlueBits (pfd.cBlueBits());
@@ -409,7 +410,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
return res;
}
- protected static boolean glCapabilities2iattributes(GLCapabilities capabilities,
+ protected static boolean glCapabilities2iattributes(NWCapabilities capabilities,
int[] iattributes,
WGLExt wglExt,
boolean pbuffer,
@@ -531,7 +532,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
} else {
if (!rtt) {
// Currently we don't support non-truecolor visuals in the
- // GLCapabilities, so we don't offer the option of making
+ // NWCapabilities, so we don't offer the option of making
// color-index pbuffers.
iattributes[niattribs++] = WGLExt.WGL_PIXEL_TYPE;
iattributes[niattribs++] = WGLExt.WGL_TYPE_RGBA;
@@ -564,11 +565,11 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
return true;
}
- protected static GLCapabilities iattributes2GLCapabilities(int[] iattribs,
+ protected static NWCapabilities iattributes2NWCapabilities(int[] iattribs,
int niattribs,
int[] iresults,
boolean requireRenderToWindow) {
- GLCapabilities res = new GLCapabilities();
+ NWCapabilities res = new NWCapabilities();
for (int i = 0; i < niattribs; i++) {
int attr = iattribs[i];
switch (attr) {
diff --git a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
index 4fe0900a6..0911a2988 100644
--- a/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl.windows.wgl;
import java.nio.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import javax.media.opengl.util.BufferUtil;
@@ -57,30 +58,30 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
super();
}
- public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice device) {
return null;
}
public GLDrawable createGLDrawable(NativeWindow target,
- GLCapabilities capabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
target = NativeWindowFactory.getNativeWindow(target);
if (capabilities == null) {
- capabilities = new GLCapabilities();
+ capabilities = new NWCapabilities();
}
if (chooser == null) {
- chooser = new DefaultGLCapabilitiesChooser();
+ chooser = new DefaultNWCapabilitiesChooser();
}
return new WindowsOnscreenWGLDrawable(this, target, capabilities, chooser);
}
- public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public GLDrawableImpl createOffscreenDrawable(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
int width,
int height) {
return new WindowsOffscreenWGLDrawable(this, capabilities, chooser, width, height);
@@ -121,8 +122,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
return canCreateGLPbuffer;
}
- public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
- final GLCapabilitiesChooser chooser,
+ public GLPbuffer createGLPbuffer(final NWCapabilities capabilities,
+ final NWCapabilitiesChooser chooser,
final int initialWidth,
final int initialHeight,
final GLContext shareWith) {
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java b/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
index e4f9f4383..37d49ca44 100755
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXContext.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
index c4dc4c4c0..5496dae90 100755
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
index 88f11d259..18bb60868 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl.x11.glx;
import java.nio.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java
index 96e2d897f..c38c630b7 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
@@ -46,11 +47,11 @@ import com.sun.opengl.impl.x11.*;
public abstract class X11GLXDrawable extends GLDrawableImpl {
protected static final boolean DEBUG = Debug.debug("X11GLXDrawable");
- protected GLCapabilitiesChooser chooser;
+ protected NWCapabilitiesChooser chooser;
protected X11GLXDrawable(GLDrawableFactory factory, NativeWindow comp, boolean realized,
- GLCapabilities requestedCapabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities requestedCapabilities,
+ NWCapabilitiesChooser chooser) {
super(factory, comp, requestedCapabilities, realized);
this.chooser = chooser;
}
@@ -104,24 +105,24 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
XVisualInfo template = XVisualInfo.create();
template.screen(screen);
XVisualInfo[] infos = null;
- GLCapabilities[] caps = null;
+ NWCapabilities[] caps = null;
getFactoryImpl().lockToolkit();
try {
infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
if (infos == null) {
throw new GLException("Error while enumerating available XVisualInfos");
}
- caps = new GLCapabilities[infos.length];
+ caps = new NWCapabilities[infos.length];
for (int i = 0; i < infos.length; i++) {
- caps[i] = ((X11GLXDrawableFactory)getFactory()).xvi2GLCapabilities(display, infos[i]);
+ caps[i] = ((X11GLXDrawableFactory)getFactory()).xvi2NWCapabilities(display, infos[i]);
}
} finally {
getFactoryImpl().unlockToolkit();
}
- GLCapabilities capabilities = getRequestedGLCapabilities();
+ NWCapabilities capabilities = getRequestedNWCapabilities();
int chosen = chooser.chooseCapabilities(capabilities, caps, -1);
if (chosen < 0 || chosen >= caps.length) {
- throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
+ throw new GLException("NWCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
}
if (DEBUG) {
System.err.println("Chosen visual (" + chosen + "):");
@@ -129,7 +130,7 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
}
vis = infos[chosen];
if (vis == null) {
- throw new GLException("GLCapabilitiesChooser chose an invalid visual");
+ throw new GLException("NWCapabilitiesChooser chose an invalid visual");
}
// FIXME: the storage for the infos array is leaked (should
// clean it up somehow when we're done with the visual we're
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
index 9ee93793a..af7030272 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXDrawableFactory.java
@@ -39,6 +39,7 @@ package com.sun.opengl.impl.x11.glx;
import java.nio.*;
import java.security.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.gluegen.runtime.*;
import com.sun.gluegen.runtime.opengl.*;
@@ -48,7 +49,7 @@ import com.sun.opengl.impl.x11.*;
public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
protected static final boolean DEBUG = Debug.debug("X11GLXDrawableFactory");
- // Map for rediscovering the GLCapabilities associated with a
+ // Map for rediscovering the NWCapabilities associated with a
// particular screen and visualID after the fact
protected static Map visualToGLCapsMap = Collections.synchronizedMap(new HashMap());
// The screens for which we've already initialized it
@@ -91,15 +92,15 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
private static final int MAX_ATTRIBS = 128;
- public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice absDevice) {
return null;
}
public GLDrawable createGLDrawable(NativeWindow target,
- GLCapabilities capabilities,
- GLCapabilitiesChooser chooser) {
+ NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser) {
if (target == null) {
throw new IllegalArgumentException("Null target");
}
@@ -107,9 +108,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return new X11OnscreenGLXDrawable(this, target);
}
- public void initializeVisualToGLCapabilitiesMap(int screen,
+ public void initializeVisualToNWCapabilitiesMap(int screen,
XVisualInfo[] infos,
- GLCapabilities[] caps) {
+ NWCapabilities[] caps) {
Integer key = new Integer(screen);
if (!initializedScreenSet.contains(key)) {
for (int i = 0; i < infos.length; i++) {
@@ -122,13 +123,13 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
}
}
- public GLCapabilities lookupCapabilitiesByScreenAndVisualID(int screenIndex,
+ public NWCapabilities lookupCapabilitiesByScreenAndVisualID(int screenIndex,
long visualID) {
- return (GLCapabilities) visualToGLCapsMap.get(new ScreenAndVisualIDKey(screenIndex, visualID));
+ return (NWCapabilities) visualToGLCapsMap.get(new ScreenAndVisualIDKey(screenIndex, visualID));
}
- public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public GLDrawableImpl createOffscreenDrawable(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
int width,
int height) {
return new X11OffscreenGLXDrawable(this, capabilities, chooser, width, height);
@@ -178,8 +179,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return canCreateGLPbuffer;
}
- public GLPbuffer createGLPbuffer(final GLCapabilities capabilities,
- final GLCapabilitiesChooser chooser,
+ public GLPbuffer createGLPbuffer(final NWCapabilities capabilities,
+ final NWCapabilitiesChooser chooser,
final int initialWidth,
final int initialHeight,
final GLContext shareWith) {
@@ -227,7 +228,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return res;
}
- public GLCapabilities xvi2GLCapabilities(long display, XVisualInfo info) {
+ public NWCapabilities xvi2NWCapabilities(long display, XVisualInfo info) {
int[] tmp = new int[1];
int val = glXGetConfig(display, info, GLX.GLX_USE_GL, tmp, 0);
if (val == 0) {
@@ -239,12 +240,12 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
// Visual does not support RGBA
return null;
}
- GLCapabilities res = new GLCapabilities();
+ NWCapabilities res = new NWCapabilities();
res.setDoubleBuffered(glXGetConfig(display, info, GLX.GLX_DOUBLEBUFFER, tmp, 0) != 0);
res.setStereo (glXGetConfig(display, info, GLX.GLX_STEREO, tmp, 0) != 0);
// Note: use of hardware acceleration is determined by
// glXCreateContext, not by the XVisualInfo. Optimistically claim
- // that all GLCapabilities have the capability to be hardware
+ // that all NWCapabilities have the capability to be hardware
// accelerated.
res.setHardwareAccelerated(true);
res.setDepthBits (glXGetConfig(display, info, GLX.GLX_DEPTH_SIZE, tmp, 0));
@@ -264,7 +265,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return res;
}
- public static int[] glCapabilities2AttribList(GLCapabilities caps,
+ public static int[] glCapabilities2AttribList(NWCapabilities caps,
boolean isMultisampleAvailable,
boolean pbuffer,
long display,
@@ -354,11 +355,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
return res;
}
- public static GLCapabilities attribList2GLCapabilities(int[] iattribs,
+ public static NWCapabilities attribList2NWCapabilities(int[] iattribs,
int niattribs,
int[] ivalues,
boolean pbuffer) {
- GLCapabilities caps = new GLCapabilities();
+ NWCapabilities caps = new NWCapabilities();
for (int i = 0; i < niattribs; i++) {
int attr = iattribs[i];
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXNativeWindowFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXNativeWindowFactory.java
index 98ade1c06..ede59b349 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXNativeWindowFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXNativeWindowFactory.java
@@ -32,6 +32,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
@@ -44,8 +45,8 @@ import com.sun.opengl.impl.x11.*;
abstractions. */
public class X11GLXNativeWindowFactory extends NativeWindowFactoryImpl {
- public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice absDevice) {
if (absDevice != null &&
!(absDevice instanceof X11GraphicsDevice)) {
@@ -62,14 +63,14 @@ public class X11GLXNativeWindowFactory extends NativeWindowFactoryImpl {
}
/** Returns the visual ID of the chosen GraphicsConfiguration. */
- protected long chooseGraphicsConfigurationImpl(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ protected long chooseGraphicsConfigurationImpl(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
int screen) {
if (capabilities == null) {
- capabilities = new GLCapabilities();
+ capabilities = new NWCapabilities();
}
if (chooser == null) {
- chooser = new DefaultGLCapabilitiesChooser();
+ chooser = new DefaultNWCapabilitiesChooser();
}
if (X11Util.isXineramaEnabled()) {
@@ -82,7 +83,7 @@ public class X11GLXNativeWindowFactory extends NativeWindowFactoryImpl {
int[] attribs = X11GLXDrawableFactory.glCapabilities2AttribList(capabilities, X11Util.isMultisampleAvailable(), false, 0, 0);
XVisualInfo[] infos = null;
- GLCapabilities[] caps = null;
+ NWCapabilities[] caps = null;
int recommendedIndex = -1;
getDefaultFactory().getToolkitLock().lock();
try {
@@ -103,9 +104,9 @@ public class X11GLXNativeWindowFactory extends NativeWindowFactoryImpl {
if (infos == null) {
throw new GLException("Error while enumerating available XVisualInfos");
}
- caps = new GLCapabilities[infos.length];
+ caps = new NWCapabilities[infos.length];
for (int i = 0; i < infos.length; i++) {
- caps[i] = ((X11GLXDrawableFactory) GLDrawableFactory.getFactory()).xvi2GLCapabilities(display, infos[i]);
+ caps[i] = ((X11GLXDrawableFactory) GLDrawableFactory.getFactory()).xvi2NWCapabilities(display, infos[i]);
// Attempt to find the visual chosen by glXChooseVisual
if (recommendedVis != null && recommendedVis.visualid() == infos[i].visualid()) {
recommendedIndex = i;
@@ -116,14 +117,14 @@ public class X11GLXNativeWindowFactory extends NativeWindowFactoryImpl {
}
// Store these away for later
((X11GLXDrawableFactory) GLDrawableFactory.getFactory()).
- initializeVisualToGLCapabilitiesMap(screen, infos, caps);
+ initializeVisualToNWCapabilitiesMap(screen, infos, caps);
int chosen = chooser.chooseCapabilities(capabilities, caps, recommendedIndex);
if (chosen < 0 || chosen >= caps.length) {
- throw new GLException("GLCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
+ throw new GLException("NWCapabilitiesChooser specified invalid index (expected 0.." + (caps.length - 1) + ")");
}
XVisualInfo vis = infos[chosen];
if (vis == null) {
- throw new GLException("GLCapabilitiesChooser chose an invalid visual");
+ throw new GLException("NWCapabilitiesChooser chose an invalid visual");
}
return vis.visualid();
}
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
index d0d03d06b..68c775323 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
@@ -48,8 +49,8 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable {
private boolean isDoubleBuffered;
protected X11OffscreenGLXDrawable(GLDrawableFactory factory,
- GLCapabilities requestedCapabilities,
- GLCapabilitiesChooser chooser,
+ NWCapabilities requestedCapabilities,
+ NWCapabilitiesChooser chooser,
int width,
int height) {
super(factory, new NullWindow(), true, requestedCapabilities, chooser);
@@ -90,7 +91,7 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable {
", GLXPixmap " + toHexString(drawable) +
", display " + toHexString(dpy));
}
- setChosenGLCapabilities(((X11GLXDrawableFactory)getFactory()).xvi2GLCapabilities(dpy, vis));
+ setChosenNWCapabilities(((X11GLXDrawableFactory)getFactory()).xvi2NWCapabilities(dpy, vis));
} finally {
getFactoryImpl().unlockToolkit();
}
@@ -129,7 +130,7 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable {
drawable = 0;
pixmap = 0;
display = 0;
- setChosenGLCapabilities(null);
+ setChosenNWCapabilities(null);
} finally {
getFactoryImpl().unlockToolkit();
}
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java
index f1743a8b4..ed6b4018e 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXContext.java
@@ -41,6 +41,7 @@ package com.sun.opengl.impl.x11.glx;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
@@ -60,10 +61,10 @@ public class X11OnscreenGLXContext extends X11GLXContext {
protected int makeCurrentImpl() throws GLException {
int lockRes = drawable.lockSurface();
- if (drawable.getChosenGLCapabilities() == null) {
+ if (drawable.getChosenNWCapabilities() == null) {
X11GLXDrawableFactory factory = (X11GLXDrawableFactory) drawable.getFactory();
NativeWindow window = drawable.getNativeWindow();
- drawable.setChosenGLCapabilities(factory.lookupCapabilitiesByScreenAndVisualID(window.getScreenIndex(),
+ drawable.setChosenNWCapabilities(factory.lookupCapabilitiesByScreenAndVisualID(window.getScreenIndex(),
window.getVisualID()));
}
boolean exceptionOccurred = false;
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
index ac228b68a..ee92b82f2 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
@@ -78,15 +79,15 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
}
// This is public to allow access from the DrawableFactory
- protected void setChosenGLCapabilities(GLCapabilities caps) {
- super.setChosenGLCapabilities(caps);
+ protected void setChosenNWCapabilities(NWCapabilities caps) {
+ super.setChosenNWCapabilities(caps);
}
public void setRealized(boolean realized) {
if (realized) {
X11GLXDrawableFactory factory = (X11GLXDrawableFactory) getFactory();
NativeWindow window = getNativeWindow();
- setChosenGLCapabilities(factory.lookupCapabilitiesByScreenAndVisualID(window.getScreenIndex(),
+ setChosenNWCapabilities(factory.lookupCapabilitiesByScreenAndVisualID(window.getScreenIndex(),
window.getVisualID()));
}
super.setRealized(realized);
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
index a32ee99d7..831fef9fc 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXContext.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
index d720fe7e8..0803075f9 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
@@ -39,6 +39,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.x11.*;
@@ -53,7 +54,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
protected static final int MAX_ATTRIBS = 256;
protected X11PbufferGLXDrawable(GLDrawableFactory factory,
- GLCapabilities requestedCapabilities,
+ NWCapabilities requestedCapabilities,
int width, int height) {
super(factory, new NullWindow(), true, requestedCapabilities, null);
if (width <= 0 || height <= 0) {
@@ -103,7 +104,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
int screen = X11Lib.DefaultScreen(display);
nw.setScreenIndex(screen);
- GLCapabilities capabilities = getRequestedGLCapabilities();
+ NWCapabilities capabilities = getRequestedNWCapabilities();
if (capabilities.getPbufferRenderToTexture()) {
throw new GLException("Render-to-texture pbuffers not supported yet on X11");
@@ -171,7 +172,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
int samplesAttrib = X11Util.isMultisampleAvailable() ? GLX.GLX_SAMPLES: GLX.GLX_RED_SIZE;
int floatNV = capabilities.getPbufferFloatingPointBuffers() ? GLXExt.GLX_FLOAT_COMPONENTS_NV : GLX.GLX_RED_SIZE;
- // Query the fbconfig to determine its GLCapabilities
+ // Query the fbconfig to determine its NWCapabilities
int[] iattribs = {
GLX.GLX_DOUBLEBUFFER,
GLX.GLX_STEREO,
@@ -192,7 +193,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
int[] ivalues = new int[iattribs.length];
queryFBConfig(display, fbConfig, iattribs, iattribs.length, ivalues);
- setChosenGLCapabilities(X11GLXDrawableFactory.attribList2GLCapabilities(iattribs, iattribs.length, ivalues, true));
+ setChosenNWCapabilities(X11GLXDrawableFactory.attribList2NWCapabilities(iattribs, iattribs.length, ivalues, true));
// Determine the actual width and height we were able to create.
int[] tmp = new int[1];
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11Util.java b/src/classes/com/sun/opengl/impl/x11/glx/X11Util.java
index 480c607a4..3f2c4fe75 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11Util.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11Util.java
@@ -32,6 +32,7 @@
package com.sun.opengl.impl.x11.glx;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.*;
diff --git a/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXNativeWindowFactory.java b/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXNativeWindowFactory.java
index 11da7af05..50a246706 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXNativeWindowFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/awt/X11AWTGLXNativeWindowFactory.java
@@ -35,6 +35,7 @@ package com.sun.opengl.impl.x11.glx.awt;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import javax.media.opengl.awt.*;
@@ -45,8 +46,8 @@ import com.sun.opengl.impl.x11.*;
import com.sun.opengl.impl.x11.glx.*;
public class X11AWTGLXNativeWindowFactory extends X11GLXNativeWindowFactory {
- public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
- GLCapabilitiesChooser chooser,
+ public AbstractGraphicsConfiguration chooseGraphicsConfiguration(NWCapabilities capabilities,
+ NWCapabilitiesChooser chooser,
AbstractGraphicsDevice absDevice) {
GraphicsDevice device = null;
if (absDevice != null &&