diff options
author | Sven Gothel <[email protected]> | 2015-08-31 08:41:07 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-08-31 08:41:07 +0200 |
commit | cf9e2f2cb8ead7efd7751dcbfaecb36ed06cf9d6 (patch) | |
tree | 5b0879c7146983221074ed9c687be2fba7db779d /make/config/nativewindow/x11-lib.cfg | |
parent | cc00d9b6c5a5c6b71ba14311fc6b17ce932d9a1e (diff) |
Bug 1210 - Use manual impl. XRenderFindVisualFormat instead of buggy generated version
- XRenderDirectFormat XVisual2XRenderMask(..):
- Move from JOGL's X11GLXGraphicsConfiguration -> Nativewindow X11GraphicsConfiguration
- Always use manual impl. of XRenderFindVisualFormat
Additionally:
- Add X11GraphicsConfiguration.XVisualInfo2X11Capabilities(..)
allowing to properly setup the resulting Capabilities instance
as used in X11GraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(..)
- XVisualInfo:
- Add 'String toString()'
- 'XVisualInfo create(XVisualInfo s)' uses source buffer size!
- XGetVisualInfo: Use returned buffer-capacity/count for element-size
and also bail out if count<=0
Diffstat (limited to 'make/config/nativewindow/x11-lib.cfg')
-rw-r--r-- | make/config/nativewindow/x11-lib.cfg | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/make/config/nativewindow/x11-lib.cfg b/make/config/nativewindow/x11-lib.cfg index 66bd19362..0bbe1c420 100644 --- a/make/config/nativewindow/x11-lib.cfg +++ b/make/config/nativewindow/x11-lib.cfg @@ -13,6 +13,7 @@ NativeOutputDir gensrc/native/X11 Import java.nio.* Import java.util.* Import com.jogamp.nativewindow.util.Point +Import com.jogamp.common.util.Bitfield # XID needs to be treated as a long for 32/64 bit compatibility Opaque long XID @@ -31,6 +32,7 @@ ReturnValueCapacity XRenderFindVisualFormat sizeof(XRenderPictFormat) # We have Custom code for the following Ignore XGetVisualInfo +Ignore XRenderFindVisualFormat ManuallyImplement XCloseDisplay ManuallyImplement XUnlockDisplay @@ -40,7 +42,12 @@ ManuallyImplement XLockDisplay CustomJavaCode X11Lib private static int getFirstElement(IntBuffer buf) { return buf.get(buf.position()); } CustomJavaCode X11Lib private static int getFirstElement(int[] arr, int offset) { return arr[offset]; } -CustomJavaCode XVisualInfo public static XVisualInfo create(XVisualInfo s) { XVisualInfo d = XVisualInfo.create(); d.getBuffer().put(s.getBuffer()); d.getBuffer().rewind(); s.getBuffer().rewind(); return d; } +CustomJavaCode XVisualInfo public static XVisualInfo create(XVisualInfo s) { final ByteBuffer bb = Buffers.newDirectByteBuffer(s.getBuffer().capacity()); final XVisualInfo d = XVisualInfo.create(bb); d.getBuffer().put(s.getBuffer()); d.getBuffer().rewind(); s.getBuffer().rewind(); return d; } +CustomJavaCode XVisualInfo public String toString() { +CustomJavaCode XVisualInfo return "XVisualInfo[size "+size()+"/"+getBuffer().capacity()+", visual 0x"+Long.toHexString(getVisual())+ +CustomJavaCode XVisualInfo ", visual-id 0x"+Long.toHexString(getVisualid())+", c-class "+getC_class()+", cmap-size "+getColormap_size()+", depth "+getDepth()+ +CustomJavaCode XVisualInfo ", rgb["+Bitfield.Util.bitCount((int)getRed_mask())+", "+Bitfield.Util.bitCount((int)getRed_mask())+", "+Bitfield.Util.bitCount((int)getRed_mask())+" - "+getBits_per_rgb()+"]]"; +CustomJavaCode XVisualInfo } CustomCCode #include <gluegen_stdint.h> CustomCCode #include <gluegen_stddef.h> |