comparison src/video/android/SDL_androidgl.c @ 4711:ed040b480a9f

- Restructured threads and application structure. - Moved to SurfaceView instead of GLSurfaceView - Moved to C++ for the android library
author Paul Hunkin <paul@bieh.net>
date Tue, 29 Jun 2010 00:40:12 +1200
parents aeac51289991
children faa228f7ce5b
comparison
equal deleted inserted replaced
4710:aeac51289991 4711:ed040b480a9f
39 #include <pthread.h> 39 #include <pthread.h>
40 40
41 /* 41 /*
42 These things are in the JNI android support 42 These things are in the JNI android support
43 */ 43 */
44 extern pthread_mutex_t mSDLRenderMutex; 44 extern void sdl_create_context();
45 extern pthread_cond_t mSDLRenderCondition;
46 extern void sdl_render(); 45 extern void sdl_render();
47 46
48 /* GL functions */ 47 /* GL functions */
49 int Android_GL_LoadLibrary(_THIS, const char *path){ 48 int Android_GL_LoadLibrary(_THIS, const char *path){
50 __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n"); 49 __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
66 return 0; 65 return 0;
67 } 66 }
68 */ 67 */
69 68
70 SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){ 69 SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){
71 __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_CreateContext\n"); 70 sdl_create_context();
72 return 1; 71 return 1;
73 } 72 }
74 73
75 int Android_GL_MakeCurrent(_THIS, SDL_Window * window, 74 int Android_GL_MakeCurrent(_THIS, SDL_Window * window,
76 SDL_GLContext context){ 75 SDL_GLContext context){
87 __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n"); 86 __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n");
88 return 0; 87 return 0;
89 } 88 }
90 89
91 void Android_GL_SwapWindow(_THIS, SDL_Window * window){ 90 void Android_GL_SwapWindow(_THIS, SDL_Window * window){
92
93 /*
94 pthread_mutex_lock(&mSDLRenderMutex);
95 pthread_cond_wait(&mSDLRenderCondition, &mSDLRenderMutex);
96 pthread_mutex_unlock(&mSDLRenderMutex);
97 */
98
99 //__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SwapWindow\n");
100 sdl_render(); 91 sdl_render();
101
102 } 92 }
103 93
104 void Android_GL_DeleteContext(_THIS, SDL_GLContext context){ 94 void Android_GL_DeleteContext(_THIS, SDL_GLContext context){
105 __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n"); 95 __android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
106 } 96 }