summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-02-10 21:55:09 +0000
committerKenneth Russel <[email protected]>2006-02-10 21:55:09 +0000
commitb75d4a3718b1a5744218e19c4f5c1a9ff0311f34 (patch)
tree62aae19c178f4ea8fe2798c23096db5b999e1012
parent4b14f14cbb84c3d60d3fb501d78873c574eec6bd (diff)
Added more debugging output on X11 side to track down Linux problems
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@596 232f8b59-042b-4e1e-8c03-345bb8c30851
-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();
}