diff options
author | Sven Gothel <[email protected]> | 2011-09-30 15:58:43 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-30 15:58:43 +0200 |
commit | db693cac03de91a20f1964cd8aa3965252027b50 (patch) | |
tree | ce3d3408161b3287fd1dade7245ce71e9a160589 /src/newt/native/AndroidWindow.c | |
parent | 68236f5193d5da825f1ca3163350a14bf5d7c051 (diff) |
NEWT/Android: More ANativeWindow coop;
Note: surface's format _is_ the nativeVisualID of EGL.
More ANativeWindow (ANW) coop:
- add acquire/release for ANW
- validate ANW format
- Add fixCaps: 'format -> GLCaps' validation
Test:
- Constructor: Start w/ surface format RGB_565 (default)
- createNative: Filter EGLConfig w/ surface format
- Move surfaceHandle fetching from surfaceCreated -> surfaceChanged,
where the format is available.
- surfaceChanged: use fixedCaps validation
Diffstat (limited to 'src/newt/native/AndroidWindow.c')
-rw-r--r-- | src/newt/native/AndroidWindow.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/newt/native/AndroidWindow.c b/src/newt/native/AndroidWindow.c index 5eca96fc2..d75bc27d7 100644 --- a/src/newt/native/AndroidWindow.c +++ b/src/newt/native/AndroidWindow.c @@ -30,6 +30,13 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_android_AndroidWindow_getSurface return (jlong) (intptr_t) anw; } +JNIEXPORT jint JNICALL Java_jogamp_newt_driver_android_AndroidWindow_getSurfaceVisualID + (JNIEnv *env, jclass clazz, jlong surfaceHandle) +{ + ANativeWindow * anw = (ANativeWindow *) (intptr_t) surfaceHandle; + return (jint) ANativeWindow_getFormat(anw); +} + JNIEXPORT void JNICALL Java_jogamp_newt_driver_android_AndroidWindow_setSurfaceVisualID (JNIEnv *env, jclass clazz, jlong surfaceHandle, jint nativeVisualID) { @@ -37,6 +44,20 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_android_AndroidWindow_setSurfaceV ANativeWindow_setBuffersGeometry(anw, 0, 0, nativeVisualID); } +JNIEXPORT void JNICALL Java_jogamp_newt_driver_android_AndroidWindow_acquire + (JNIEnv *env, jclass clazz, jlong surfaceHandle) +{ + ANativeWindow * anw = (ANativeWindow *) (intptr_t) surfaceHandle; + ANativeWindow_acquire(anw); +} + +JNIEXPORT void JNICALL Java_jogamp_newt_driver_android_AndroidWindow_release + (JNIEnv *env, jclass clazz, jlong surfaceHandle) +{ + ANativeWindow * anw = (ANativeWindow *) (intptr_t) surfaceHandle; + ANativeWindow_release(anw); +} + JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_android_AndroidWindow_initIDs (JNIEnv *env, jclass clazz) { |