From b7ad260cd68b0cbbe1e61b95ed8c90aa97487186 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 8 Mar 2023 05:25:34 +0100 Subject: [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. --- .../classes/jogamp/opengl/x11/glx/X11GLCapabilities.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/jogl/classes') 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; @@ -91,6 +92,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) { -- cgit v1.2.3