Tweaks to the libsdl side
authorPaul Hunkin
Fri, 18 Jun 2010 01:29:14 +1200
changeset 47096dc26b9d8368
parent 4708 f3f65cb6a382
child 4710 aeac51289991
Tweaks to the libsdl side
src/video/android/SDL_androidgl.c
     1.1 --- a/src/video/android/SDL_androidgl.c	Fri Jun 18 01:28:39 2010 +1200
     1.2 +++ b/src/video/android/SDL_androidgl.c	Fri Jun 18 01:29:14 2010 +1200
     1.3 @@ -36,12 +36,13 @@
     1.4  
     1.5  #include <android/log.h>
     1.6  
     1.7 +#include <pthread.h>
     1.8  
     1.9  /*
    1.10  These things are in the JNI android support
    1.11  */
    1.12 - 
    1.13 -
    1.14 +extern pthread_mutex_t mSDLRenderMutex;
    1.15 +extern pthread_cond_t mSDLRenderCondition;
    1.16  
    1.17  /* GL functions */
    1.18  int Android_GL_LoadLibrary(_THIS, const char *path){
    1.19 @@ -67,7 +68,7 @@
    1.20  
    1.21  SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){
    1.22  	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_CreateContext\n");
    1.23 -	return NULL; 
    1.24 +	return 1;
    1.25  }
    1.26  
    1.27  int Android_GL_MakeCurrent(_THIS, SDL_Window * window,
    1.28 @@ -87,7 +88,14 @@
    1.29  }
    1.30  
    1.31  void Android_GL_SwapWindow(_THIS, SDL_Window * window){
    1.32 -	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SwapWindow\n");
    1.33 +
    1.34 +	pthread_mutex_lock(&mSDLRenderMutex);
    1.35 +	pthread_cond_wait(&mSDLRenderCondition, &mSDLRenderMutex);
    1.36 +	pthread_mutex_unlock(&mSDLRenderMutex);
    1.37 +	
    1.38 +	
    1.39 +	//__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SwapWindow\n");
    1.40 +
    1.41  }
    1.42  
    1.43  void Android_GL_DeleteContext(_THIS, SDL_GLContext context){