diff options
author | Sven Gothel <[email protected]> | 2023-03-08 05:25:34 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-08 05:25:34 +0100 |
commit | b7ad260cd68b0cbbe1e61b95ed8c90aa97487186 (patch) | |
tree | 1cc10e64a36c80bd53e0546863703bc41e1ec3ad /src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java | |
parent | 058ebd3072fd86550e147147bce784f14310abae (diff) |
[GL]Capabilities*: Enhance identity-check in root Capabilities.equals(..), comparing the VisualID first; Added VisualIDHolder.isVisualIDSupported(VIDType)
We cannot accept 2 capabilities with different VisualID but same attributes otherwise accepted as equal,
since the underlying windowing system uniquely identifies them via their VisualID.
Such comparison is used in certail GLAutoDrawable implementations like AWT GLCanvas
to determine a configuration change etc.
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java index 740289fa6..8c74ba090 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java @@ -32,6 +32,7 @@ import jogamp.nativewindow.x11.XVisualInfo; import com.jogamp.nativewindow.NativeWindowException; import com.jogamp.nativewindow.VisualIDHolder; +import com.jogamp.nativewindow.VisualIDHolder.VIDType; import com.jogamp.opengl.GLCapabilities; import com.jogamp.opengl.GLException; import com.jogamp.opengl.GLProfile; @@ -92,6 +93,19 @@ public class X11GLCapabilities extends GLCapabilities { } @Override + final public boolean isVisualIDSupported(final VIDType type) { + switch(type) { + case INTRINSIC: + case NATIVE: + case X11_XVISUAL: + case X11_FBCONFIG: + return true; + default: + return false; + } + } + + @Override public StringBuilder toString(StringBuilder sink) { if(null == sink) { sink = new StringBuilder(); |