# HG changeset patch # User Paul Hunkin # Date 1276781354 -43200 # Node ID 6dc26b9d836876b41c20b9030ca97094ab1b0c4a # Parent f3f65cb6a382ce5c9dd32f678d880b444ecbd2e7 Tweaks to the libsdl side diff -r f3f65cb6a382 -r 6dc26b9d8368 src/video/android/SDL_androidgl.c --- a/src/video/android/SDL_androidgl.c Fri Jun 18 01:28:39 2010 +1200 +++ b/src/video/android/SDL_androidgl.c Fri Jun 18 01:29:14 2010 +1200 @@ -36,12 +36,13 @@ #include +#include /* These things are in the JNI android support */ - - +extern pthread_mutex_t mSDLRenderMutex; +extern pthread_cond_t mSDLRenderCondition; /* GL functions */ int Android_GL_LoadLibrary(_THIS, const char *path){ @@ -67,7 +68,7 @@ SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){ __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_CreateContext\n"); - return NULL; + return 1; } int Android_GL_MakeCurrent(_THIS, SDL_Window * window, @@ -87,7 +88,14 @@ } void Android_GL_SwapWindow(_THIS, SDL_Window * window){ - __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SwapWindow\n"); + + pthread_mutex_lock(&mSDLRenderMutex); + pthread_cond_wait(&mSDLRenderCondition, &mSDLRenderMutex); + pthread_mutex_unlock(&mSDLRenderMutex); + + + //__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SwapWindow\n"); + } void Android_GL_DeleteContext(_THIS, SDL_GLContext context){