aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun')
-rw-r--r--src/classes/com/sun/javafx/newt/GLWindow.java25
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/NewtFactory.java10
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/Window.java38
-rw-r--r--src/classes/com/sun/javafx/newt/awt/AWTWindow.java11
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/kd/KDDisplay.java6
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/kd/KDWindow.java14
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/macosx/MacWindow.java9
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/windows/WindowsWindow.java15
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/x11/X11Window.java12
-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
-rwxr-xr-xsrc/classes/com/sun/opengl/util/awt/TextRenderer.java3
54 files changed, 298 insertions, 249 deletions
diff --git a/src/classes/com/sun/javafx/newt/GLWindow.java b/src/classes/com/sun/javafx/newt/GLWindow.java
index 23f959799..53943b087 100644
--- a/src/classes/com/sun/javafx/newt/GLWindow.java
+++ b/src/classes/com/sun/javafx/newt/GLWindow.java
@@ -33,6 +33,7 @@
package com.sun.javafx.newt;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import com.sun.opengl.impl.GLDrawableHelper;
@@ -83,7 +84,7 @@ public class GLWindow extends Window implements GLAutoDrawable {
}
/** Creates a new GLWindow on the local display, screen 0, with a
- dummy visual ID, and with the default GLCapabilities. */
+ dummy visual ID, and with the default NWCapabilities. */
public static GLWindow create() {
return create(null, null);
}
@@ -96,26 +97,26 @@ public class GLWindow extends Window implements GLAutoDrawable {
public static GLWindow create(Window window) {
return create(window, null);
}
- public static GLWindow create(GLCapabilities caps) {
+ public static GLWindow create(NWCapabilities caps) {
return create(caps, false);
}
/** Creates a new GLWindow on the local display, screen 0, with a
- dummy visual ID, and with the given GLCapabilities. */
- public static GLWindow create(GLCapabilities caps, boolean undecorated) {
+ dummy visual ID, and with the given NWCapabilities. */
+ public static GLWindow create(NWCapabilities caps, boolean undecorated) {
return create(null, caps, undecorated);
}
- /** Creates a new GLWindow referring to the given window, and with the given GLCapabilities. */
- public static GLWindow create(Window window, GLCapabilities caps) {
+ /** Creates a new GLWindow referring to the given window, and with the given NWCapabilities. */
+ public static GLWindow create(Window window, NWCapabilities caps) {
return create(window, caps, false);
}
public static GLWindow create(Window window,
- GLCapabilities caps,
+ NWCapabilities caps,
boolean undecorated) {
if (caps == null) {
- caps = new GLCapabilities();
+ caps = new NWCapabilities();
}
if (window == null) {
Display display = NewtFactory.createDisplay(null); // local display
@@ -126,7 +127,7 @@ public class GLWindow extends Window implements GLAutoDrawable {
return new GLWindow(window);
}
- protected void createNative(GLCapabilities caps) {
+ protected void createNative(NWCapabilities caps) {
shouldNotCallThis();
}
@@ -463,11 +464,11 @@ public class GLWindow extends Window implements GLAutoDrawable {
public void setRealized(boolean realized) {
}
- public GLCapabilities getChosenGLCapabilities() {
+ public NWCapabilities getChosenNWCapabilities() {
if (drawable == null)
return null;
- return drawable.getChosenGLCapabilities();
+ return drawable.getChosenNWCapabilities();
}
public NativeWindow getNativeWindow() {
@@ -479,6 +480,6 @@ public class GLWindow extends Window implements GLAutoDrawable {
//
private void shouldNotCallThis() {
- throw new RuntimeException("Should not call this");
+ throw new NativeWindowException("Should not call this");
}
}
diff --git a/src/classes/com/sun/javafx/newt/NewtFactory.java b/src/classes/com/sun/javafx/newt/NewtFactory.java
index f9f8678af..312c6f825 100755
--- a/src/classes/com/sun/javafx/newt/NewtFactory.java
+++ b/src/classes/com/sun/javafx/newt/NewtFactory.java
@@ -33,7 +33,7 @@
package com.sun.javafx.newt;
-import javax.media.opengl.GLCapabilities;
+import javax.media.nwi.NWCapabilities;
import java.util.ArrayList;
import java.util.Iterator;
@@ -124,18 +124,18 @@ public abstract class NewtFactory {
/**
* Create a Window entity, incl native creation
*/
- public static Window createWindow(Screen screen, GLCapabilities caps) {
+ public static Window createWindow(Screen screen, NWCapabilities caps) {
return Window.create(getWindowType(), screen, caps);
}
- public static Window createWindow(Screen screen, GLCapabilities caps, boolean undecorated) {
+ public static Window createWindow(Screen screen, NWCapabilities caps, boolean undecorated) {
return Window.create(getWindowType(), screen, caps, undecorated);
}
/**
* Create a Window entity using the given implementation type, incl native creation
*/
- public static Window createWindow(String type, Screen screen, GLCapabilities caps) {
+ public static Window createWindow(String type, Screen screen, NWCapabilities caps) {
return Window.create(type, screen, caps);
}
@@ -156,7 +156,7 @@ public abstract class NewtFactory {
/**
* Instantiate a Window entity using the native handle.
*/
- public static Window wrapWindow(Screen screen, GLCapabilities caps, long visualID,
+ public static Window wrapWindow(Screen screen, NWCapabilities caps, long visualID,
long windowHandle, boolean fullscreen, boolean visible,
int x, int y, int width, int height) {
return Window.wrapHandle(getWindowType(), screen, caps, visualID,
diff --git a/src/classes/com/sun/javafx/newt/Window.java b/src/classes/com/sun/javafx/newt/Window.java
index 155eda8a3..a1e983c3c 100755
--- a/src/classes/com/sun/javafx/newt/Window.java
+++ b/src/classes/com/sun/javafx/newt/Window.java
@@ -33,9 +33,9 @@
package com.sun.javafx.newt;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.NativeWindow;
-import javax.media.opengl.NativeWindowException;
+import javax.media.nwi.NWCapabilities;
+import javax.media.nwi.NativeWindow;
+import javax.media.nwi.NativeWindowException;
import java.util.ArrayList;
import java.util.Iterator;
@@ -76,16 +76,16 @@ public abstract class Window implements NativeWindow
} else if (NewtFactory.AWT.equals(type)) {
windowClass = Class.forName("com.sun.javafx.newt.awt.AWTWindow");
} else {
- throw new RuntimeException("Unknown window type \"" + type + "\"");
+ throw new NativeWindowException("Unknown window type \"" + type + "\"");
}
return windowClass;
}
- protected static Window create(String type, Screen screen, GLCapabilities caps) {
+ protected static Window create(String type, Screen screen, NWCapabilities caps) {
return create(type, screen, caps, false);
}
- protected static Window create(String type, Screen screen, GLCapabilities caps, boolean undecorated) {
+ protected static Window create(String type, Screen screen, NWCapabilities caps, boolean undecorated) {
try {
Class windowClass = getWindowClass(type);
Window window = (Window) windowClass.newInstance();
@@ -97,11 +97,11 @@ public abstract class Window implements NativeWindow
return window;
} catch (Throwable t) {
t.printStackTrace();
- throw new RuntimeException(t);
+ throw new NativeWindowException(t);
}
}
- protected static Window wrapHandle(String type, Screen screen, GLCapabilities caps, long visualID,
+ protected static Window wrapHandle(String type, Screen screen, NWCapabilities caps, long visualID,
long windowHandle, boolean fullscreen, boolean visible,
int x, int y, int width, int height)
{
@@ -122,7 +122,7 @@ public abstract class Window implements NativeWindow
return window;
} catch (Throwable t) {
t.printStackTrace();
- throw new RuntimeException(t);
+ throw new NativeWindowException(t);
}
}
@@ -132,7 +132,7 @@ public abstract class Window implements NativeWindow
* Shall use the capabilities to determine the visualID
* and shall set chosenCaps.
*/
- protected abstract void createNative(GLCapabilities caps);
+ protected abstract void createNative(NWCapabilities caps);
protected abstract void closeNative();
@@ -176,11 +176,11 @@ public abstract class Window implements NativeWindow
protected Screen screen;
/**
- * The GLCapabilities shall be used to determine the visualID
+ * The NWCapabilities shall be used to determine the visualID
*/
- protected GLCapabilities chosenCaps;
+ protected NWCapabilities chosenCaps;
/**
- * The visualID shall be determined using the GLCapabilities
+ * The visualID shall be determined using the NWCapabilities
*/
protected long visualID;
protected long windowHandle;
@@ -288,12 +288,12 @@ public abstract class Window implements NativeWindow
return windowHandle; // default: return window handle
}
- public GLCapabilities getChosenCapabilities() {
+ public NWCapabilities getChosenCapabilities() {
if (chosenCaps == null)
return null;
// Must return a new copy to avoid mutation by end user
- return (GLCapabilities) chosenCaps.clone();
+ return (NWCapabilities) chosenCaps.clone();
}
public long getVisualID() {
@@ -377,7 +377,7 @@ public abstract class Window implements NativeWindow
", mod "+modifiers+", pos "+x+"/"+y+", button "+button);
}
if(button<0||button>MouseEvent.BUTTON_NUMBER) {
- throw new RuntimeException("Invalid mouse button number" + button);
+ throw new NativeWindowException("Invalid mouse button number" + button);
}
long when = System.currentTimeMillis();
MouseEvent eClicked = null;
@@ -455,7 +455,7 @@ public abstract class Window implements NativeWindow
l.mouseDragged(e);
break;
default:
- throw new RuntimeException("Unexpected mouse event type " + e.getEventType());
+ throw new NativeWindowException("Unexpected mouse event type " + e.getEventType());
}
}
}
@@ -511,7 +511,7 @@ public abstract class Window implements NativeWindow
l.keyTyped(e);
break;
default:
- throw new RuntimeException("Unexpected key event type " + e.getEventType());
+ throw new NativeWindowException("Unexpected key event type " + e.getEventType());
}
}
}
@@ -563,7 +563,7 @@ public abstract class Window implements NativeWindow
l.windowMoved(e);
break;
default:
- throw new RuntimeException("Unexpected window event type " + e.getEventType());
+ throw new NativeWindowException("Unexpected window event type " + e.getEventType());
}
}
}
diff --git a/src/classes/com/sun/javafx/newt/awt/AWTWindow.java b/src/classes/com/sun/javafx/newt/awt/AWTWindow.java
index ee3e97a38..8badf6d4e 100644
--- a/src/classes/com/sun/javafx/newt/awt/AWTWindow.java
+++ b/src/classes/com/sun/javafx/newt/awt/AWTWindow.java
@@ -47,7 +47,8 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import com.sun.javafx.newt.Window;
-import javax.media.opengl.GLCapabilities;
+import javax.media.nwi.NWCapabilities;
+import javax.media.nwi.NativeWindowException;
/** An implementation of the Newt Window class built using the
AWT. This is provided for convenience of porting to platforms
@@ -74,8 +75,8 @@ public class AWTWindow extends Window {
}
}
- protected void createNative(GLCapabilities caps) {
- chosenCaps = (GLCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
+ protected void createNative(NWCapabilities caps) {
+ chosenCaps = (NWCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
visualID = 0; // n/a
runOnEDT(new Runnable() {
public void run() {
@@ -206,7 +207,7 @@ public class AWTWindow extends Window {
break;
default:
- throw new RuntimeException("Unknown event type " + w.getType());
+ throw new NativeWindowException("Unknown event type " + w.getType());
}
if(DEBUG_MOUSE_EVENT) {
System.out.println("dispatchMessages: in event:"+w.getEvent());
@@ -242,7 +243,7 @@ public class AWTWindow extends Window {
try {
EventQueue.invokeAndWait(r);
} catch (Exception e) {
- throw new RuntimeException(e);
+ throw new NativeWindowException(e);
}
}
}
diff --git a/src/classes/com/sun/javafx/newt/kd/KDDisplay.java b/src/classes/com/sun/javafx/newt/kd/KDDisplay.java
index 92f41bc0b..6128c3e77 100755
--- a/src/classes/com/sun/javafx/newt/kd/KDDisplay.java
+++ b/src/classes/com/sun/javafx/newt/kd/KDDisplay.java
@@ -36,7 +36,7 @@ package com.sun.javafx.newt.kd;
import com.sun.javafx.newt.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.egl.*;
-import javax.media.opengl.GLException;
+import javax.media.nwi.NativeWindowException;
public class KDDisplay extends Display {
static {
@@ -50,10 +50,10 @@ public class KDDisplay extends Display {
// FIXME: map name to EGL_*_DISPLAY
handle = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY);
if (handle == EGL.EGL_NO_DISPLAY) {
- throw new GLException("eglGetDisplay failed");
+ throw new NativeWindowException("eglGetDisplay failed");
}
if (!EGL.eglInitialize(handle, null, null)) {
- throw new GLException("eglInitialize failed");
+ throw new NativeWindowException("eglInitialize failed");
}
}
}
diff --git a/src/classes/com/sun/javafx/newt/kd/KDWindow.java b/src/classes/com/sun/javafx/newt/kd/KDWindow.java
index 44e297a92..01570e1bb 100755
--- a/src/classes/com/sun/javafx/newt/kd/KDWindow.java
+++ b/src/classes/com/sun/javafx/newt/kd/KDWindow.java
@@ -36,9 +36,9 @@ package com.sun.javafx.newt.kd;
import com.sun.javafx.newt.*;
import com.sun.opengl.impl.*;
import com.sun.opengl.impl.egl.*;
-import javax.media.opengl.GLCapabilities;
+import javax.media.nwi.NWCapabilities;
import javax.media.opengl.GLProfile;
-import javax.media.opengl.NativeWindowException;
+import javax.media.nwi.NativeWindowException;
public class KDWindow extends Window {
private static final String WINDOW_CLASS_NAME = "NewtWindow";
@@ -49,14 +49,14 @@ public class KDWindow extends Window {
NativeLibLoader.loadNEWT();
if (!initIDs()) {
- throw new RuntimeException("Failed to initialize jmethodIDs");
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
}
}
public KDWindow() {
}
- protected void createNative(GLCapabilities caps) {
+ protected void createNative(NWCapabilities caps) {
int eglRenderableType;
if(GLProfile.isGLES1()) {
eglRenderableType = EGL.EGL_OPENGL_ES_BIT;
@@ -74,13 +74,13 @@ public class KDWindow extends Window {
windowID = ++_windowID;
eglWindowHandle = CreateWindow(windowID, getDisplayHandle(), config.getAttributeList());
if (eglWindowHandle == 0) {
- throw new RuntimeException("Error creating egl window: "+eglWindowHandle);
+ throw new NativeWindowException("Error creating egl window: "+eglWindowHandle);
}
setVisible0(eglWindowHandle, false);
/*
windowHandle = RealizeWindow(eglWindowHandle);
if (0 == windowHandle) {
- throw new RuntimeException("Error native Window Handle is null");
+ throw new NativeWindowException("Error native Window Handle is null");
} */
windowHandleClose = eglWindowHandle;
}
@@ -98,7 +98,7 @@ public class KDWindow extends Window {
if ( 0==windowHandle ) {
windowHandle = RealizeWindow(eglWindowHandle);
if (0 == windowHandle) {
- throw new RuntimeException("Error native Window Handle is null");
+ throw new NativeWindowException("Error native Window Handle is null");
}
}
clearEventMask();
diff --git a/src/classes/com/sun/javafx/newt/macosx/MacWindow.java b/src/classes/com/sun/javafx/newt/macosx/MacWindow.java
index 345ebe0e1..f80f0b3ab 100755
--- a/src/classes/com/sun/javafx/newt/macosx/MacWindow.java
+++ b/src/classes/com/sun/javafx/newt/macosx/MacWindow.java
@@ -33,7 +33,8 @@
package com.sun.javafx.newt.macosx;
-import javax.media.opengl.GLCapabilities;
+import javax.media.nwi.NWCapabilities;
+import javax.media.nwi.NativeWindowException;
import com.sun.javafx.newt.*;
import com.sun.opengl.impl.*;
@@ -135,15 +136,15 @@ public class MacWindow extends Window {
NativeLibLoader.loadNEWT();
if (!initIDs()) {
- throw new RuntimeException("Failed to initialize jmethodIDs");
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
}
}
public MacWindow() {
}
- protected void createNative(GLCapabilities caps) {
- chosenCaps = (GLCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
+ protected void createNative(NWCapabilities caps) {
+ chosenCaps = (NWCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
visualID = 0; // n/a
}
diff --git a/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java b/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java
index de05f0951..8b9d635e8 100755
--- a/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java
+++ b/src/classes/com/sun/javafx/newt/windows/WindowsWindow.java
@@ -33,7 +33,8 @@
package com.sun.javafx.newt.windows;
-import javax.media.opengl.GLCapabilities;
+import javax.media.nwi.NWCapabilities;
+import javax.media.nwi.NativeWindowException;
import com.sun.javafx.newt.*;
import com.sun.opengl.impl.*;
@@ -48,7 +49,7 @@ public class WindowsWindow extends Window {
NativeLibLoader.loadNEWT();
if (!initIDs()) {
- throw new RuntimeException("Failed to initialize jmethodIDs");
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
}
}
@@ -62,13 +63,13 @@ public class WindowsWindow extends Window {
return hdc;
}
- protected void createNative(GLCapabilities caps) {
+ protected void createNative(NWCapabilities caps) {
long wndClass = getWindowClass();
- chosenCaps = (GLCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
+ chosenCaps = (NWCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
visualID = 0; // n/a
windowHandle = CreateWindow(WINDOW_CLASS_NAME, getHInstance(), visualID, x, y, width, height);
if (windowHandle == 0) {
- throw new RuntimeException("Error creating window");
+ throw new NativeWindowException("Error creating window");
}
windowHandleClose = windowHandle;
}
@@ -125,7 +126,7 @@ public class WindowsWindow extends Window {
if (windowClass == 0) {
windowClass = RegisterWindowClass(WINDOW_CLASS_NAME, getHInstance());
if (windowClass == 0) {
- throw new RuntimeException("Error while registering window class");
+ throw new NativeWindowException("Error while registering window class");
}
}
return windowClass;
@@ -135,7 +136,7 @@ public class WindowsWindow extends Window {
if (hInstance == 0) {
hInstance = LoadLibraryW("newt");
if (hInstance == 0) {
- throw new RuntimeException("Error finding HINSTANCE for \"newt\"");
+ throw new NativeWindowException("Error finding HINSTANCE for \"newt\"");
}
}
return hInstance;
diff --git a/src/classes/com/sun/javafx/newt/x11/X11Window.java b/src/classes/com/sun/javafx/newt/x11/X11Window.java
index ee0846e1b..312cc161d 100755
--- a/src/classes/com/sun/javafx/newt/x11/X11Window.java
+++ b/src/classes/com/sun/javafx/newt/x11/X11Window.java
@@ -35,8 +35,8 @@ package com.sun.javafx.newt.x11;
import com.sun.javafx.newt.*;
import com.sun.opengl.impl.*;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.NativeWindowException;
+import javax.media.nwi.NWCapabilities;
+import javax.media.nwi.NativeWindowException;
public class X11Window extends Window {
private static final String WINDOW_CLASS_NAME = "NewtWindow";
@@ -47,19 +47,19 @@ public class X11Window extends Window {
NativeLibLoader.loadNEWT();
if (!initIDs()) {
- throw new RuntimeException("Failed to initialize jmethodIDs");
+ throw new NativeWindowException("Failed to initialize jmethodIDs");
}
}
public X11Window() {
}
- protected void createNative(GLCapabilities caps) {
- chosenCaps = (GLCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
+ protected void createNative(NWCapabilities caps) {
+ chosenCaps = (NWCapabilities) caps.clone(); // FIXME: visualID := f1(caps); caps := f2(visualID)
visualID = 0; // n/a
long w = CreateWindow(getDisplayHandle(), getScreenHandle(), getScreenIndex(), visualID, x, y, width, height);
if (w == 0 || w!=windowHandle) {
- throw new RuntimeException("Error creating window: "+w);
+ throw new NativeWindowException("Error creating window: "+w);
}
windowHandleClose = windowHandle;
displayHandleClose = getDisplayHandle();
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 &&
diff --git a/src/classes/com/sun/opengl/util/awt/TextRenderer.java b/src/classes/com/sun/opengl/util/awt/TextRenderer.java
index 6c9aa578b..4e80dfaa4 100755
--- a/src/classes/com/sun/opengl/util/awt/TextRenderer.java
+++ b/src/classes/com/sun/opengl/util/awt/TextRenderer.java
@@ -66,6 +66,7 @@ import java.text.*;
import java.util.*;
+import javax.media.nwi.*;
import javax.media.opengl.*;
import javax.media.opengl.glu.*;
import javax.media.opengl.glu.gl2.*;
@@ -901,7 +902,7 @@ public class TextRenderer {
private void debug() {
dbgFrame = new Frame("TextRenderer Debug Output");
- GLCanvas dbgCanvas = new GLCanvas(new GLCapabilities(), null,
+ GLCanvas dbgCanvas = new GLCanvas(new NWCapabilities(), null,
GLContext.getCurrent(), null);
dbgCanvas.addGLEventListener(new DebugListener(dbgFrame));
dbgFrame.add(dbgCanvas);