Search
lxdream.org :: lxdream/src/gui_android.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gui_android.c
changeset 1282:9f445c5e252b
prev1278:2f0de47738d0
author nkeynes
date Tue Mar 27 08:23:52 2012 +1000 (10 years ago)
permissions -rw-r--r--
last change Android: Preserve render buffers when switching away from app.
- fix gl_read_render_buffer + gl_load_frame_buffer to work in GLES
a) glReadPixels only (guaranteed to) work for GL_RGBA,GL_UNSIGNED_BYTE
b) glTexSubImage2D can only load GL_RGBA into a GL_RGBA render buffer.
file annotate diff log raw
1.1 --- a/src/gui_android.c Wed Mar 21 14:44:14 2012 +1000
1.2 +++ b/src/gui_android.c Tue Mar 27 08:23:52 2012 +1000
1.3 @@ -39,6 +39,7 @@
1.4 #include "drivers/video_egl.h"
1.5 #include "maple/maple.h"
1.6 #include "vmu/vmulist.h"
1.7 +#include "pvr2/pvr2.h"
1.8
1.9 struct surface_info {
1.10 ANativeWindow *win;
1.11 @@ -86,6 +87,8 @@
1.12 {
1.13 struct surface_info *surface = (struct surface_info *)data;
1.14 video_egl_set_window(surface->win, surface->width, surface->height, surface->format);
1.15 + pvr2_restore_render_buffers();
1.16 + pvr2_draw_frame();
1.17 INFO( "set_surface" );
1.18 return 0;
1.19 }
1.20 @@ -97,6 +100,7 @@
1.21 if( dreamcast_is_running() ) {
1.22 dreamcast_stop(); /* Should already be stopped, but just in case */
1.23 }
1.24 + pvr2_preserve_render_buffers();
1.25 video_egl_clear_window();
1.26 ANativeWindow_release(surface->win);
1.27 surface->win = NULL;
1.28 @@ -112,6 +116,7 @@
1.29
1.30 pthread_attr_init(&attr);
1.31 pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
1.32 + pthread_attr_setstacksize(&attr,2048*1024);
1.33 int status = pthread_create(&dreamcast_thread, &attr, android_thread_main, NULL);
1.34 if( status != 0 ) {
1.35 /* Handle errors */
.