summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java5
-rw-r--r--src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java24
2 files changed, 27 insertions, 2 deletions
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java
index 61d4a70f5..c11404b9f 100644
--- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java
+++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawable.java
@@ -104,6 +104,11 @@ public abstract class X11GLDrawable extends GLDrawableImpl {
if (infos == null || infos.length == 0) {
throw new GLException("Error while getting XVisualInfo for visual ID " + visualID);
}
+ if (DEBUG) {
+ System.err.println("!!! Fetched XVisualInfo for visual ID 0x" + Long.toHexString(visualID));
+ System.err.println("!!! Resulting XVisualInfo: visualid = 0x" + Long.toHexString(infos[0].visualid()));
+ }
+
// FIXME: the storage for the infos array is leaked (should
// clean it up somehow when we're done with the visual we're
// returning)
diff --git a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
index 248371c37..c7b0e1a0c 100644
--- a/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
+++ b/src/classes/com/sun/opengl/impl/x11/X11GLDrawableFactory.java
@@ -114,6 +114,14 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
try {
long display = getDisplayConnection();
XVisualInfo recommendedVis = GLX.glXChooseVisual(display, screen, attribs, 0);
+ if (DEBUG) {
+ System.err.print("!!! glXChooseVisual recommended ");
+ if (recommendedVis == null) {
+ System.err.println("null visual");
+ } else {
+ System.err.println("visual id 0x" + Long.toHexString(recommendedVis.visualid()));
+ }
+ }
int[] count = new int[1];
XVisualInfo template = XVisualInfo.create();
template.screen(screen);
@@ -194,6 +202,8 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
try {
int[] major = new int[1];
int[] minor = new int[1];
+ int screen = 0; // FIXME: provide way to specify this?
+
if (!GLX.glXQueryVersion(display, major, 0, minor, 0)) {
throw new GLException("glXQueryVersion failed");
}
@@ -202,8 +212,6 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
", minor " + minor[0]);
}
- int screen = 0; // FIXME: provide way to specify this?
-
// Work around bugs in ATI's Linux drivers where they report they
// only implement GLX version 1.2 on the server side
if (major[0] == 1 && minor[0] == 2) {
@@ -419,6 +427,18 @@ public class X11GLDrawableFactory extends GLDrawableFactoryImpl {
getX11Factory().lockToolkit();
try {
staticDisplay = GLX.XOpenDisplay(null);
+ if (DEBUG && (staticDisplay != 0)) {
+ long display = staticDisplay;
+ int screen = 0; // FIXME
+ System.err.println("!!! GLX server vendor : " +
+ GLX.glXQueryServerString(display, screen, GLX.GLX_VENDOR));
+ System.err.println("!!! GLX server version: " +
+ GLX.glXQueryServerString(display, screen, GLX.GLX_VERSION));
+ System.err.println("!!! GLX client vendor : " +
+ GLX.glXGetClientString(display, GLX.GLX_VENDOR));
+ System.err.println("!!! GLX client version: " +
+ GLX.glXGetClientString(display, GLX.GLX_VERSION));
+ }
} finally {
getX11Factory().unlockToolkit();
}