diff options
author | Sven Gothel <[email protected]> | 2014-02-23 14:51:06 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2014-02-23 14:51:06 +0100 |
commit | 3352601e0860584509adf2b76f993d03893ded4b (patch) | |
tree | 974fccc8c0eb2f5ad9d4ffd741dfc35869ed67b5 /src/newt/native/KDWindow.c | |
parent | f51933f0ebe9ae030c26c066e59a728ce08b8559 (diff) | |
parent | c67de337a8aaf52e36104c3f13e273aa19d21f1f (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 'src/newt/native/KDWindow.c')
-rw-r--r-- | src/newt/native/KDWindow.c | 53 |
1 files changed, 20 insertions, 33 deletions
diff --git a/src/newt/native/KDWindow.c b/src/newt/native/KDWindow.c index dc999138c..cfec60dc1 100644 --- a/src/newt/native/KDWindow.c +++ b/src/newt/native/KDWindow.c @@ -42,8 +42,9 @@ #include <gluegen_stdint.h> #include <KD/kd.h> +#include <EGL/egl.h> -#include "jogamp_newt_driver_kd_KDWindow.h" +#include "jogamp_newt_driver_kd_WindowDriver.h" #include "MouseEvent.h" #include "KeyEvent.h" @@ -81,7 +82,7 @@ static jmethodID sendKeyEventID = NULL; * Display */ -JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDDisplay_DispatchMessages +JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_DisplayDriver_DispatchMessages (JNIEnv *env, jobject obj) { const KDEvent * evt; @@ -160,14 +161,14 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDDisplay_DispatchMessages if(KD_INPUT_POINTER_SELECT==ptr->index) { DBG_PRINT( "event mouse click: src: %p, s:%d, (%d,%d)\n", userData, ptr->select, ptr->x, ptr->y); (*env)->CallVoidMethod(env, javaWindow, sendMouseEventID, - (ptr->select==0) ? (jint) EVENT_MOUSE_RELEASED : (jint) EVENT_MOUSE_PRESSED, + (ptr->select==0) ? (jshort) EVENT_MOUSE_RELEASED : (jshort) EVENT_MOUSE_PRESSED, (jint) 0, - (jint) ptr->x, (jint) ptr->y, 1, 0); + (jint) ptr->x, (jint) ptr->y, (short)1, 0.0f); } else { DBG_PRINT( "event mouse: src: %d, s:%p, i:0x%X (%d,%d)\n", userData, ptr->select, ptr->index, ptr->x, ptr->y); - (*env)->CallVoidMethod(env, javaWindow, sendMouseEventID, (jint) EVENT_MOUSE_MOVED, + (*env)->CallVoidMethod(env, javaWindow, sendMouseEventID, (jshort) EVENT_MOUSE_MOVED, 0, - (jint) ptr->x, (jint) ptr->y, 0, 0); + (jint) ptr->x, (jint) ptr->y, (jshort)0, 0.0f); } } break; @@ -179,7 +180,7 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDDisplay_DispatchMessages * Window */ -JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_kd_KDWindow_initIDs +JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_kd_WindowDriver_initIDs (JNIEnv *env, jclass clazz) { #ifdef VERBOSE_ON @@ -192,8 +193,8 @@ JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_kd_KDWindow_initIDs sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(ZIIZ)V"); visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(ZZ)V"); windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "(Z)Z"); - sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V"); - sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V"); + sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(SIIISF)V"); + sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(SISSC)V"); if (windowCreatedID == NULL || sizeChangedID == NULL || visibleChangedID == NULL || @@ -207,12 +208,11 @@ JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_kd_KDWindow_initIDs return JNI_TRUE; } -JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_kd_KDWindow_CreateWindow - (JNIEnv *env, jobject obj, jlong display, jintArray jAttrs) +JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_kd_WindowDriver_CreateWindow + (JNIEnv *env, jobject obj, jlong display, jlong jeglConfig) { - jint * attrs = NULL; - jsize attrsLen; EGLDisplay dpy = (EGLDisplay)(intptr_t)display; + EGLConfig eglConfig = (EGLConfig)(intptr_t)jeglConfig; KDWindow *window = 0; if(dpy==NULL) { @@ -220,22 +220,9 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_kd_KDWindow_CreateWindow return 0; } - attrsLen = (*env)->GetArrayLength(env, jAttrs); - if(0==attrsLen) { - fprintf(stderr, "[CreateWindow] attribute array size 0..\n"); - return 0; - } - attrs = (*env)->GetIntArrayElements(env, jAttrs, 0); - if(NULL==attrs) { - fprintf(stderr, "[CreateWindow] attribute array NULL..\n"); - return 0; - } - JOGLKDUserdata * userData = kdMalloc(sizeof(JOGLKDUserdata)); userData->magic = JOGL_KD_USERDATA_MAGIC; - window = kdCreateWindow(dpy, attrs, (void *)userData); - - (*env)->ReleaseIntArrayElements(env, jAttrs, attrs, 0); + window = kdCreateWindow(dpy, eglConfig, (void *)userData); if(NULL==window) { kdFree(userData); @@ -249,7 +236,7 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_kd_KDWindow_CreateWindow return (jlong) (intptr_t) window; } -JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_kd_KDWindow_RealizeWindow +JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_kd_WindowDriver_RealizeWindow (JNIEnv *env, jobject obj, jlong window) { KDWindow *w = (KDWindow*) (intptr_t) window; @@ -264,7 +251,7 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_kd_KDWindow_RealizeWindow return (jlong) (intptr_t) nativeWindow; } -JNIEXPORT jint JNICALL Java_jogamp_newt_driver_kd_KDWindow_CloseWindow +JNIEXPORT jint JNICALL Java_jogamp_newt_driver_kd_WindowDriver_CloseWindow (JNIEnv *env, jobject obj, jlong window, jlong juserData) { KDWindow *w = (KDWindow*) (intptr_t) window; @@ -278,11 +265,11 @@ JNIEXPORT jint JNICALL Java_jogamp_newt_driver_kd_KDWindow_CloseWindow } /* - * Class: jogamp_newt_driver_kd_KDWindow + * Class: jogamp_newt_driver_kd_WindowDriver * Method: setVisible0 * Signature: (JJZ)V */ -JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDWindow_setVisible0 +JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_WindowDriver_setVisible0 (JNIEnv *env, jobject obj, jlong window, jboolean visible) { KDWindow *w = (KDWindow*) (intptr_t) window; @@ -292,7 +279,7 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDWindow_setVisible0 (*env)->CallVoidMethod(env, obj, visibleChangedID, JNI_FALSE, visible); // FIXME: or defer=true ? } -JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDWindow_setFullScreen0 +JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_WindowDriver_setFullScreen0 (JNIEnv *env, jobject obj, jlong window, jboolean fullscreen) { /** not supported, due to missing NV property .. @@ -309,7 +296,7 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDWindow_setFullScreen0 (void)fullscreen; } -JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_KDWindow_setSize0 +JNIEXPORT void JNICALL Java_jogamp_newt_driver_kd_WindowDriver_setSize0 (JNIEnv *env, jobject obj, jlong window, jint width, jint height) { KDWindow *w = (KDWindow*) (intptr_t) window; |