diff options
author | dhewg | 2011-03-02 19:38:40 +0100 |
---|---|---|
committer | dhewg | 2011-03-02 23:18:34 +0100 |
commit | 82a9beff2b52b2dd3eb7368dd46d8d50cb9f2d9f (patch) | |
tree | 7f333ebcd8d9a75dd0c9d17cd501844ea53414fc /backends/platform/android/jni.h | |
parent | bd7e3e9bb20dada6d40143557c473fabd373b5ed (diff) | |
download | scummvm-rg350-82a9beff2b52b2dd3eb7368dd46d8d50cb9f2d9f.tar.gz scummvm-rg350-82a9beff2b52b2dd3eb7368dd46d8d50cb9f2d9f.tar.bz2 scummvm-rg350-82a9beff2b52b2dd3eb7368dd46d8d50cb9f2d9f.zip |
ANDROID: Move swapBuffers to the native side
Diffstat (limited to 'backends/platform/android/jni.h')
-rw-r--r-- | backends/platform/android/jni.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/backends/platform/android/jni.h b/backends/platform/android/jni.h index 0005136966..2a1405dfcc 100644 --- a/backends/platform/android/jni.h +++ b/backends/platform/android/jni.h @@ -60,8 +60,8 @@ public: static void showVirtualKeyboard(bool enable); static void addSysArchivesToSearchSet(Common::SearchSet &s, int priority); - static inline int swapBuffers(); - static void initSurface(); + static inline bool swapBuffers(); + static bool initSurface(); static void deinitSurface(); static void setAudioPause(); @@ -76,6 +76,9 @@ private: // back pointer to (java) peer instance static jobject _jobj; static jobject _jobj_audio_track; + static jobject _jobj_egl; + static jobject _jobj_egl_display; + static jobject _jobj_egl_surface; static Common::Archive *_asset_archive; static OSystem_Android *_system; @@ -97,10 +100,11 @@ private: static jmethodID _MID_showVirtualKeyboard; static jmethodID _MID_getSysArchives; static jmethodID _MID_getPluginDirectories; - static jmethodID _MID_swapBuffers; static jmethodID _MID_initSurface; static jmethodID _MID_deinitSurface; + static jmethodID _MID_EGL10_eglSwapBuffers; + static jmethodID _MID_AudioTrack_flush; static jmethodID _MID_AudioTrack_pause; static jmethodID _MID_AudioTrack_play; @@ -113,8 +117,10 @@ private: static void throwRuntimeException(JNIEnv *env, const char *msg); // natives for the dark side - static void create(JNIEnv *env, jobject self, jobject am, jobject at, - jint sample_rate, jint buffer_size); + static void create(JNIEnv *env, jobject self, jobject asset_manager, + jobject egl, jobject egl_display, + jobject at, jint audio_sample_rate, + jint audio_buffer_size); static void destroy(JNIEnv *env, jobject self); static void setSurface(JNIEnv *env, jobject self, jint width, jint height); @@ -124,10 +130,11 @@ private: static void enableZoning(JNIEnv *env, jobject self, jboolean enable); }; -inline int JNI::swapBuffers() { +inline bool JNI::swapBuffers() { JNIEnv *env = JNI::getEnv(); - return env->CallIntMethod(_jobj, _MID_swapBuffers); + return env->CallBooleanMethod(_jobj_egl, _MID_EGL10_eglSwapBuffers, + _jobj_egl_display, _jobj_egl_surface); } inline int JNI::writeAudio(JNIEnv *env, jbyteArray &data, int offset, int size) { |