diff options
author | Sven Gothel <sgothel@jausoft.com> | 2023-03-08 05:25:34 +0100 |
---|---|---|
committer | Sven Gothel <sgothel@jausoft.com> | 2023-03-08 05:25:34 +0100 |
commit | b7ad260cd68b0cbbe1e61b95ed8c90aa97487186 (patch) | |
tree | 1cc10e64a36c80bd53e0546863703bc41e1ec3ad /src/nativewindow/classes/jogamp | |
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/nativewindow/classes/jogamp')
-rw-r--r-- | src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java index 99cfca97b..71bd033b0 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java +++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java @@ -1,5 +1,5 @@ /** - * Copyright 2012 JogAmp Community. All rights reserved. + * Copyright 2012-2023 JogAmp Community. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: @@ -74,6 +74,19 @@ public class X11Capabilities extends Capabilities { } @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(); |