aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun
diff options
context:
space:
mode:
Diffstat (limited to 'src/classes/com/sun')
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/Window.java4
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/x11/X11Window.java4
-rw-r--r--src/classes/com/sun/opengl/impl/NullWindow.java3
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java4
-rw-r--r--src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java10
-rwxr-xr-xsrc/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java10
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java8
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java4
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java4
-rw-r--r--src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java8
10 files changed, 28 insertions, 31 deletions
diff --git a/src/classes/com/sun/javafx/newt/Window.java b/src/classes/com/sun/javafx/newt/Window.java
index c485a93b1..8b6688c3b 100755
--- a/src/classes/com/sun/javafx/newt/Window.java
+++ b/src/classes/com/sun/javafx/newt/Window.java
@@ -216,6 +216,10 @@ public abstract class Window implements NativeWindow
return windowHandle;
}
+ public long getSurfaceHandle() {
+ return windowHandle; // default: return window handle
+ }
+
public long getVisualID() {
return visualID;
}
diff --git a/src/classes/com/sun/javafx/newt/x11/X11Window.java b/src/classes/com/sun/javafx/newt/x11/X11Window.java
index 217ce5cdb..10fd1acd5 100755
--- a/src/classes/com/sun/javafx/newt/x11/X11Window.java
+++ b/src/classes/com/sun/javafx/newt/x11/X11Window.java
@@ -53,10 +53,6 @@ public class X11Window extends Window {
public X11Window() {
}
- public long getSurfaceHandle() {
- throw new NativeWindowException("Unsupported and unnecessary on the X11 platform");
- }
-
protected void createNative() {
long w = CreateWindow(getDisplayHandle(), getScreenHandle(), getScreenIndex(), visualID, x, y, width, height);
if (w == 0 || w!=windowHandle) {
diff --git a/src/classes/com/sun/opengl/impl/NullWindow.java b/src/classes/com/sun/opengl/impl/NullWindow.java
index da64c2538..e5c0b82ea 100644
--- a/src/classes/com/sun/opengl/impl/NullWindow.java
+++ b/src/classes/com/sun/opengl/impl/NullWindow.java
@@ -95,9 +95,6 @@ public class NullWindow implements NativeWindow {
public long getWindowHandle() {
return windowHandle;
}
- public void setWindowHandle(long handle) {
- windowHandle=handle;
- }
public long getSurfaceHandle() {
return surfaceHandle;
}
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 ad71774b5..ff5fbbdff 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXCGLContext.java
@@ -135,7 +135,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl
try {
// Try to allocate a context with this
nsContext = CGL.createContext(share,
- drawable.getNativeWindow().getWindowHandle(),
+ drawable.getNativeWindow().getSurfaceHandle(),
pixelFormat,
viewNotReady, 0);
if (nsContext == 0) {
@@ -232,7 +232,7 @@ public abstract class MacOSXCGLContext extends GLContextImpl
}
protected int makeCurrentImpl() throws GLException {
- if (drawable.getNativeWindow().getWindowHandle() == 0) {
+ if (drawable.getNativeWindow().getSurfaceHandle() == 0) {
if (DEBUG) {
System.err.println("drawable not properly initialized");
}
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 6efe175fe..d5291af39 100644
--- a/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -66,9 +66,9 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
try {
NullWindow nw = (NullWindow) getNativeWindow();
- if (nw.getWindowHandle() != 0) {
- impl.destroy(nw.getWindowHandle());
- nw.setWindowHandle(0);
+ if (nw.getSurfaceHandle() != 0) {
+ impl.destroy(nw.getSurfaceHandle());
+ nw.setSurfaceHandle(0);
if (DEBUG) {
System.err.println("Destroyed pbuffer: " + nw);
@@ -86,7 +86,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
}
public long getPbuffer() {
- return getNativeWindow().getWindowHandle();
+ return getNativeWindow().getSurfaceHandle();
}
public void swapBuffers() throws GLException {
@@ -134,7 +134,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
if (pBuffer == 0) {
throw new GLException("pbuffer creation error: CGL.createPBuffer() failed");
}
- nw.setWindowHandle(pBuffer);
+ nw.setSurfaceHandle(pBuffer);
} finally {
getFactory().unlockToolkit();
}
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 a982a4605..bbb33bd42 100755
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11ExternalGLXDrawable.java
@@ -85,7 +85,7 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val, 0);
int screen = val[0];
NullWindow nw = new NullWindow();
- nw.setWindowHandle(drawable);
+ nw.setSurfaceHandle(drawable);
nw.setScreenIndex(screen);
return new X11ExternalGLXDrawable(factory, nw);
} finally {
@@ -118,7 +118,7 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
}
protected int makeCurrentImpl() throws GLException {
- if (drawable.getNativeWindow().getWindowHandle() == 0) {
+ if (drawable.getNativeWindow().getSurfaceHandle() == 0) {
// parent drawable not properly initialized
// FIXME: signal error?
if (DEBUG) {
@@ -141,14 +141,14 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
}
if (!GLX.glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(),
- drawable.getNativeWindow().getWindowHandle(),
+ drawable.getNativeWindow().getSurfaceHandle(),
readDrawable,
context)) {
throw new GLException("Error making context current");
} else {
if (DEBUG && VERBOSE) {
System.err.println(getThreadName() + ": glXMakeCurrent(display " + toHexString(drawable.getNativeWindow().getDisplayHandle()) +
- ", drawable " + toHexString(drawable.getNativeWindow().getWindowHandle()) +
+ ", drawable " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) +
", context " + toHexString(context) + ") succeeded");
}
}
@@ -222,7 +222,7 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
if (DEBUG) {
System.err.println("Created context " + toHexString(context) +
- " for GLXDrawable " + toHexString(drawable.getNativeWindow().getWindowHandle()));
+ " for GLXDrawable " + toHexString(drawable.getNativeWindow().getSurfaceHandle()));
}
}
}
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 2821a3049..457240503 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11GLXContext.java
@@ -124,7 +124,7 @@ public abstract class X11GLXContext extends GLContextImpl {
}
protected int makeCurrentImpl() throws GLException {
- if (drawable.getNativeWindow().getWindowHandle() == 0) {
+ if (drawable.getNativeWindow().getSurfaceHandle() == 0) {
if (DEBUG) {
System.err.println("drawable not properly initialized");
}
@@ -141,15 +141,15 @@ public abstract class X11GLXContext extends GLContextImpl {
if (GLX.glXGetCurrentContext() != context) {
if (!GLX.glXMakeContextCurrent(drawable.getNativeWindow().getDisplayHandle(),
- drawable.getNativeWindow().getWindowHandle(),
- drawable.getNativeWindow().getWindowHandle(),
+ drawable.getNativeWindow().getSurfaceHandle(),
+ drawable.getNativeWindow().getSurfaceHandle(),
context)) {
throw new GLException("Error making context current");
} else {
if (DEBUG && (VERBOSE || created)) {
System.err.println(getThreadName() + ": glXMakeCurrent(display " +
toHexString(drawable.getNativeWindow().getDisplayHandle()) +
- ", drawable " + toHexString(drawable.getNativeWindow().getWindowHandle()) +
+ ", drawable " + toHexString(drawable.getNativeWindow().getSurfaceHandle()) +
", context " + toHexString(context) + ") succeeded");
}
}
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 9d5e7ac16..446d6f4e5 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
@@ -85,7 +85,7 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable {
pixmap = 0;
throw new GLException("glXCreateGLXPixmap failed");
}
- nw.setWindowHandle(drawable);
+ nw.setSurfaceHandle(drawable);
isDoubleBuffered = (X11GLXDrawableFactory.glXGetConfig(dpy, vis, GLX.GLX_DOUBLEBUFFER, new int[1], 0) != 0);
if (DEBUG) {
System.err.println("Created pixmap " + toHexString(pixmap) +
@@ -103,7 +103,7 @@ public class X11OffscreenGLXDrawable extends X11GLXDrawable {
try {
NativeWindow nw = getNativeWindow();
long display = nw.getDisplayHandle();
- long drawable = nw.getWindowHandle();
+ long drawable = nw.getSurfaceHandle();
if (DEBUG) {
System.err.println("Destroying pixmap " + toHexString(pixmap) +
", GLXPixmap " + toHexString(drawable) +
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 120ec56bb..1741ba72a 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11OnscreenGLXDrawable.java
@@ -69,7 +69,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
try {
boolean didLock = false;
- if (component.getWindowHandle() == 0) {
+ if (component.getSurfaceHandle() == 0) {
if (lockSurface() == NativeWindow.LOCK_SURFACE_NOT_READY) {
return;
}
@@ -77,7 +77,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
didLock = true;
}
- GLX.glXSwapBuffers(component.getDisplayHandle(), component.getWindowHandle());
+ GLX.glXSwapBuffers(component.getDisplayHandle(), component.getSurfaceHandle());
if (didLock) {
unlockSurface();
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 0d09f6600..3f29095cb 100644
--- a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
@@ -81,9 +81,9 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
getFactory().lockToolkit();
try {
NullWindow nw = (NullWindow) getNativeWindow();
- if (nw.getWindowHandle() != 0) {
- GLX.glXDestroyPbuffer(nw.getDisplayHandle(), nw.getWindowHandle());
- nw.setWindowHandle(0);
+ if (nw.getSurfaceHandle() != 0) {
+ GLX.glXDestroyPbuffer(nw.getDisplayHandle(), nw.getSurfaceHandle());
+ nw.setSurfaceHandle(0);
}
nw.setDisplayHandle(0);
} finally {
@@ -164,7 +164,7 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
}
// Set up instance variables
- nw.setWindowHandle(drawable);
+ nw.setSurfaceHandle(drawable);
this.fbConfig = fbConfig;
// Pick innocent query values if multisampling or floating point buffers not available