From 5c404353ee7d8cd5a5ffb29b3b086ad890f46c91 Mon Sep 17 00:00:00 2001 From: Paul Hunkin Date: Fri, 18 Jun 2010 01:29:14 +1200 Subject: [PATCH] Tweaks to the libsdl side --- src/video/android/SDL_androidgl.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/video/android/SDL_androidgl.c b/src/video/android/SDL_androidgl.c index 9f8712e86..b10f57615 100644 --- a/src/video/android/SDL_androidgl.c +++ b/src/video/android/SDL_androidgl.c @@ -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 @@ int *Android_GL_GetVisual(_THIS, Display * display, int screen){ 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 @@ int Android_GL_GetSwapInterval(_THIS){ } 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){