aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android/org/inodes/gus/scummvm
diff options
context:
space:
mode:
authordhewg2011-03-02 19:38:40 +0100
committerdhewg2011-03-02 23:18:34 +0100
commit82a9beff2b52b2dd3eb7368dd46d8d50cb9f2d9f (patch)
tree7f333ebcd8d9a75dd0c9d17cd501844ea53414fc /backends/platform/android/org/inodes/gus/scummvm
parentbd7e3e9bb20dada6d40143557c473fabd373b5ed (diff)
downloadscummvm-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/org/inodes/gus/scummvm')
-rw-r--r--backends/platform/android/org/inodes/gus/scummvm/ScummVM.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
index db83303c7d..75407c66cc 100644
--- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
+++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
@@ -38,6 +38,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
private String[] args;
final private native void create(AssetManager asset_manager,
+ EGL10 egl, EGLDisplay eglDisplay,
AudioTrack audio_track,
int sample_rate, int buffer_size);
final private native void destroy();
@@ -56,13 +57,6 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
abstract protected void showVirtualKeyboard(boolean enable);
abstract protected String[] getSysArchives();
- final protected int swapBuffers() {
- if (!egl.eglSwapBuffers(eglDisplay, eglSurface))
- return egl.eglGetError();
-
- return 0;
- }
-
public ScummVM(AssetManager asset_manager, SurfaceHolder holder) {
this.asset_manager = asset_manager;
sem_surface = new Object();
@@ -126,7 +120,8 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
throw new RuntimeException("Error preparing the ScummVM thread", e);
}
- create(asset_manager, audio_track, sample_rate, buffer_size);
+ create(asset_manager, egl, eglDisplay,
+ audio_track, sample_rate, buffer_size);
int res = main(args);
@@ -192,7 +187,7 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
}
// Callback from C++ peer instance
- final protected void initSurface() throws Exception {
+ final protected EGLSurface initSurface() throws Exception {
eglSurface = egl.eglCreateWindowSurface(eglDisplay, eglConfig,
surface_holder, null);
@@ -210,6 +205,8 @@ public abstract class ScummVM implements SurfaceHolder.Callback, Runnable {
gl.glGetString(GL10.GL_VERSION),
gl.glGetString(GL10.GL_RENDERER),
gl.glGetString(GL10.GL_VENDOR)));
+
+ return eglSurface;
}
// Callback from C++ peer instance