aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/glx-CustomJavaCode.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-03-10 22:14:34 +0100
committerSven Gothel <[email protected]>2014-03-10 22:14:34 +0100
commitfdd60adb1d421f2018b47ee17e9079c94b54910f (patch)
tree3be9345319ed6cccfe77b38e444dd92b2b4dba5c /make/config/jogl/glx-CustomJavaCode.java
parent132f6fe9eeada4321d776d6332482854c82f24e2 (diff)
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)
Diffstat (limited to 'make/config/jogl/glx-CustomJavaCode.java')
-rw-r--r--make/config/jogl/glx-CustomJavaCode.java19
1 files changed, 19 insertions, 0 deletions
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: <code> GLXFBConfig * glXGetFBConfigs(Display * dpy, int screen, int * nelements); </code> <br>Part of <code>GLX_VERSION_1_3</code>
+ @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: <code> GLXFBConfig * glXGetFBConfigs(Display * dpy, int screen, int * nelements); </code> <br>Part of <code>GLX_VERSION_1_3</code>
+ @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: <code> XVisualInfo * glXChooseVisual(Display * dpy, int screen, int * attribList); </code> <br>Part of <code>GLX_VERSION_1_X</code>
@param attribList a direct only {@link java.nio.IntBuffer} */