summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-02-03 07:02:31 +0100
committerSven Gothel <[email protected]>2011-02-03 07:02:31 +0100
commit63c8f5322e60e256ea2cdd07212f30a435494de4 (patch)
treec3b9eafe5df394ebd2c8fdd75ab598772a8a6a47 /src/jogl/classes/com/jogamp/opengl
parent0bc0f0219a7443ac721d15ad38508ecb4a50f26d (diff)
Fix: X11: Allowing FBConfig w/o XVisualInfo for non onscreen
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLCapabilities.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLCapabilities.java b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLCapabilities.java
index e3a1e7d72..3f9d2baae 100644
--- a/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLCapabilities.java
+++ b/src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLCapabilities.java
@@ -35,7 +35,7 @@ import javax.media.opengl.GLProfile;
import java.util.Comparator;
public class X11GLCapabilities extends GLCapabilities {
- XVisualInfo xVisualInfo;
+ XVisualInfo xVisualInfo; // maybe null if !onscreen
long fbcfg;
int fbcfgid;
@@ -94,21 +94,29 @@ public class X11GLCapabilities extends GLCapabilities {
}
final public XVisualInfo getXVisualInfo() { return xVisualInfo; }
- final public long getXVisualID() { return xVisualInfo.getVisualid(); }
+ final public long getXVisualID() { return (null!=xVisualInfo) ? xVisualInfo.getVisualid() : 0; }
+ final public boolean hasXVisualInfo() { return null!=xVisualInfo; }
final public long getFBConfig() { return fbcfg; }
final public int getFBConfigID() { return fbcfgid; }
- final public boolean isFBConfig() { return 0!=fbcfg && fbcfgid>0; }
-
+ final public boolean hasFBConfig() { return 0!=fbcfg && fbcfgid>0; }
+
+ final static String na_str = "----" ;
+
public StringBuffer toString(StringBuffer sink) {
if(null == sink) {
sink = new StringBuffer();
}
- sink.append("0x").append(Long.toHexString(xVisualInfo.getVisualid())).append(" ");
- if(isFBConfig()) {
+ if(hasXVisualInfo()) {
+ sink.append("0x").append(Long.toHexString(xVisualInfo.getVisualid()));
+ } else {
+ sink.append(na_str);
+ }
+ sink.append(" ");
+ if(hasFBConfig()) {
sink.append("0x").append(Integer.toHexString(fbcfgid));
} else {
- sink.append("----");
+ sink.append(na_str);
}
sink.append(": ");
return super.toString(sink);