diff options
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/impl')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLCapabilities.java | 22 |
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); |