summaryrefslogtreecommitdiffstats
path: root/make/config/jogl/egl-CustomJavaCode.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-02-23 14:51:06 +0100
committerSven Gothel <[email protected]>2014-02-23 14:51:06 +0100
commit3352601e0860584509adf2b76f993d03893ded4b (patch)
tree974fccc8c0eb2f5ad9d4ffd741dfc35869ed67b5 /make/config/jogl/egl-CustomJavaCode.java
parentf51933f0ebe9ae030c26c066e59a728ce08b8559 (diff)
parentc67de337a8aaf52e36104c3f13e273aa19d21f1f (diff)
Merge branch 'master' into stash_glyphcache
Conflicts: make/scripts/tests.sh src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java src/jogl/classes/com/jogamp/graph/curve/Region.java src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java src/jogl/classes/com/jogamp/graph/font/Font.java src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java src/jogl/classes/jogamp/graph/curve/text/GlyphString.java src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
Diffstat (limited to 'make/config/jogl/egl-CustomJavaCode.java')
-rw-r--r--make/config/jogl/egl-CustomJavaCode.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/make/config/jogl/egl-CustomJavaCode.java b/make/config/jogl/egl-CustomJavaCode.java
new file mode 100644
index 000000000..15689b5d8
--- /dev/null
+++ b/make/config/jogl/egl-CustomJavaCode.java
@@ -0,0 +1,45 @@
+
+ private static EGLProcAddressTable _table = new EGLProcAddressTable(new GLProcAddressResolver());
+ public static void resetProcAddressTable(DynamicLookupHelper lookup) {
+ _table.reset(lookup);
+ }
+
+ // There are some #defines in egl.h that GlueGen and PCPP don't currently handle
+ public static final long EGL_DEFAULT_DISPLAY = 0;
+ public static final long EGL_NO_CONTEXT = 0;
+ public static final long EGL_NO_DISPLAY = 0;
+ public static final long EGL_NO_SURFACE = 0;
+ public static final int EGL_DONT_CARE = -1;
+ public static final int EGL_UNKNOWN = -1;
+
+ protected static long eglGetProcAddress(long eglGetProcAddressHandle, java.lang.String procname)
+ {
+ if (eglGetProcAddressHandle == 0) {
+ throw new GLException("Passed null pointer for method \"eglGetProcAddress\"");
+ }
+ return dispatch_eglGetProcAddress0(procname, eglGetProcAddressHandle);
+ }
+
+
+ /**
+ * In case of an error on a particualr attribute, the attribute in the attributes-buffer is set to 0.
+ * <p>
+ * Entry point to C language function: <code> EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value); </code> <br>Part of <code>EGL_VERSION_1_X</code>
+ * </p>
+ */
+ public static void eglGetConfigAttributes(long dpy, long config, IntBuffer attributes, IntBuffer values) {
+ if( attributes == null || values == null ) {
+ throw new RuntimeException("arrays buffers are null");
+ }
+ if( !Buffers.isDirect(attributes) || !Buffers.isDirect(values) ) {
+ throw new RuntimeException("arrays buffers are not direct");
+ }
+ if( attributes.remaining() > values.remaining() ) {
+ throw new RuntimeException("not enough values "+values+" for attributes "+attributes);
+ }
+ final long __addr = _table._addressof_eglGetConfigAttrib;
+ dispatch_eglGetConfigAttributes(dpy, config, attributes.remaining(), attributes, Buffers.getDirectBufferByteOffset(attributes),
+ values, Buffers.getDirectBufferByteOffset(values), __addr);
+ }
+ private static native void dispatch_eglGetConfigAttributes(long dpy, long config, int attributeCount, Object attributes, int attributes_byte_offset, Object values, int valuesOffset, long procAddr);
+