From fdd60adb1d421f2018b47ee17e9079c94b54910f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 10 Mar 2014 22:14:34 +0100 Subject: Bug 961: Stabilize glXGetFBConfigAttrib(..) and glXChooseFBConfig(..) Usage Against OpenGL Bugs ; Fix glXGetFBConfigs - glXChooseFBConfig(..) - Remove NULL FBConfig pointer from result in native code, which has been observed in Mesa 8.0.5-4 libgl1-mesa-swx11 (Debian-7). - glXGetFBConfigs - Add manual implementation similar to glXChooseFBConfig - glXGetFBConfigAttrib(..) - glXGetFBConfig(..) - Returns boolean reflecting success, don't throw exception - caller handles error - Caller ignore failure if not essential (i.e. already chosen config) --- make/config/jogl/glx-CustomJavaCode.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'make/config/jogl/glx-CustomJavaCode.java') diff --git a/make/config/jogl/glx-CustomJavaCode.java b/make/config/jogl/glx-CustomJavaCode.java index 4cce05dda..5a3ea392b 100644 --- a/make/config/jogl/glx-CustomJavaCode.java +++ b/make/config/jogl/glx-CustomJavaCode.java @@ -60,6 +60,25 @@ @param nitems a direct only {@link java.nio.IntBuffer} */ private static native ByteBuffer dispatch_glXChooseFBConfig(long dpy, int screen, Object attribList, int attribList_byte_offset, Object nitems, int nitems_byte_offset, long procAddress); + /** Entry point to C language function: GLXFBConfig * glXGetFBConfigs(Display * dpy, int screen, int * nelements);
Part of GLX_VERSION_1_3 + @param nelements a direct only {@link java.nio.IntBuffer} */ + public static PointerBuffer glXGetFBConfigs(long dpy, int screen, IntBuffer nelements) { + + if (!Buffers.isDirect(nelements)) + throw new GLException("Argument \"nelements\" is not a direct buffer"); + final long __addr_ = glxProcAddressTable._addressof_glXGetFBConfigs; + if (__addr_ == 0) { + throw new GLException(String.format("Method \"%s\" not available", "glXGetFBConfigs")); + } + final ByteBuffer _res = dispatch_glXGetFBConfigs(dpy, screen, nelements, Buffers.getDirectBufferByteOffset(nelements), __addr_); + if (_res == null) return null; + return PointerBuffer.wrap(Buffers.nativeOrder(_res)); + } + + /** Entry point to C language function: GLXFBConfig * glXGetFBConfigs(Display * dpy, int screen, int * nelements);
Part of GLX_VERSION_1_3 + @param nelements a direct only {@link java.nio.IntBuffer} */ + private static native ByteBuffer dispatch_glXGetFBConfigs(long dpy, int screen, Object nelements, int nelements_byte_offset, long procAddress); + /** Entry point to C language function: XVisualInfo * glXChooseVisual(Display * dpy, int screen, int * attribList);
Part of GLX_VERSION_1_X @param attribList a direct only {@link java.nio.IntBuffer} */ -- cgit v1.2.3