changeset 4709:6dc26b9d8368

Tweaks to the libsdl side
author Paul Hunkin <paul@bieh.net>
date Fri, 18 Jun 2010 01:29:14 +1200
parents f3f65cb6a382
children aeac51289991
files src/video/android/SDL_androidgl.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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 <android/log.h>
 
+#include <pthread.h>
 
 /*
 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){