aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android
diff options
context:
space:
mode:
authordhewg2011-02-06 19:38:15 +0100
committerdhewg2011-02-14 18:58:56 +0100
commit21c2dda5ba42d65cba71c3f27bb6679ecdd01c9e (patch)
tree8860b38b8e7510a121712f4fd91779a1d68b0b77 /backends/platform/android
parentbf237c8d2c270014a95c40b7567db80ed787a67a (diff)
downloadscummvm-rg350-21c2dda5ba42d65cba71c3f27bb6679ecdd01c9e.tar.gz
scummvm-rg350-21c2dda5ba42d65cba71c3f27bb6679ecdd01c9e.tar.bz2
scummvm-rg350-21c2dda5ba42d65cba71c3f27bb6679ecdd01c9e.zip
ANDROID: Use and reinit texture on screen changes
- EVENT_SCREEN_CHANGED must happen _after_ we have a new surface, not when the the old surface vanishes. fixes port on galaxy tab - textures have to be redefined with glTexImage2D() to make glTexSubImage2D() not fail on screen changes
Diffstat (limited to 'backends/platform/android')
-rw-r--r--backends/platform/android/org/inodes/gus/scummvm/ScummVM.java3
-rw-r--r--backends/platform/android/video.cpp7
2 files changed, 8 insertions, 2 deletions
diff --git a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
index bb4a3dd061..0e905f43a5 100644
--- a/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
+++ b/backends/platform/android/org/inodes/gus/scummvm/ScummVM.java
@@ -98,11 +98,10 @@ public class ScummVM implements SurfaceHolder.Callback {
public void surfaceChanged(SurfaceHolder holder, int format,
int width, int height) {
// Disabled while I debug GL problems
- //pushEvent(new Event(Event.EVENT_SCREEN_CHANGED));
+ pushEvent(new Event(Event.EVENT_SCREEN_CHANGED));
}
public void surfaceDestroyed(SurfaceHolder holder) {
- pushEvent(new Event(Event.EVENT_SCREEN_CHANGED));
try {
surfaceLock.acquire();
} catch (InterruptedException e) {
diff --git a/backends/platform/android/video.cpp b/backends/platform/android/video.cpp
index e56c0da2af..b9c3f9a1f8 100644
--- a/backends/platform/android/video.cpp
+++ b/backends/platform/android/video.cpp
@@ -135,7 +135,14 @@ GLESTexture::~GLESTexture() {
}
void GLESTexture::reinitGL() {
+ glDeleteTextures(1, &_texture_name);
glGenTextures(1, &_texture_name);
+
+ // bypass allocBuffer() shortcut to reinit the texture properly
+ _texture_width = 0;
+ _texture_height = 0;
+
+ allocBuffer(_surface.w, _surface.h);
setDirty();
}