aboutsummaryrefslogtreecommitdiffstats
path: root/make/config/jogl/egl-CustomCCode.c
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-CustomCCode.c
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-CustomCCode.c')
-rw-r--r--make/config/jogl/egl-CustomCCode.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/make/config/jogl/egl-CustomCCode.c b/make/config/jogl/egl-CustomCCode.c
new file mode 100644
index 000000000..0163c6742
--- /dev/null
+++ b/make/config/jogl/egl-CustomCCode.c
@@ -0,0 +1,26 @@
+#include <stdio.h> /* android */
+#include <gluegen_stdint.h>
+#include <gluegen_stddef.h>
+#include <EGL/egl.h>
+
+/* Java->C glue code:
+ * Java package: jogamp.opengl.egl.EGL
+ * Java method: void eglGetConfigAttributes(long dpy, long config, IntBuffer attributes, IntBuffer values)
+ */
+Java_jogamp_opengl_egl_EGL_dispatch_1eglGetConfigAttributes(JNIEnv *env, jclass _unused, jlong dpy, jlong config, jint attributeCount, jobject attributes, jint attributes_byte_offset, jobject values, jint values_byte_offset, jlong procAddress) {
+ typedef EGLBoolean (EGLAPIENTRY*_local_PFNEGLGETCONFIGATTRIBPROC)(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint * value);
+ _local_PFNEGLGETCONFIGATTRIBPROC ptr_eglGetConfigAttrib = (_local_PFNEGLGETCONFIGATTRIBPROC) (intptr_t) procAddress;
+ assert(ptr_eglGetConfigAttrib != NULL);
+
+ if ( attributeCount > 0 && NULL != attributes ) {
+ int i;
+ int * attributes_ptr = (int *) (((char*) (*env)->GetDirectBufferAddress(env, attributes)) + attributes_byte_offset);
+ EGLint * values_ptr = (EGLint *) (((char*) (*env)->GetDirectBufferAddress(env, values)) + values_byte_offset);
+ for(i=0; i<attributeCount; i++) {
+ if( 0 == (* ptr_eglGetConfigAttrib) ((EGLDisplay) (intptr_t) dpy, (EGLConfig) (intptr_t) config, (EGLint) attributes_ptr[i], (EGLint *) &values_ptr[i]) ) {
+ attributes_ptr[i] = 0;
+ }
+ }
+ }
+}
+