fixed bug in SDL_ACTIVEEVENT

This commit is contained in:
pelya
2010-10-04 16:36:00 +03:00
parent b64beebad9
commit d85b547bad
2 changed files with 25 additions and 4 deletions
@@ -71,8 +71,11 @@ static SDL_ANDROID_ApplicationPutToBackgroundCallback_t appRestoredCallback = ap
int SDL_ANDROID_CallJavaSwapBuffers()
{
SDL_ANDROID_drawTouchscreenKeyboard();
SDL_ANDROID_processAndroidTrackballDampening();
if( !glContextLost )
{
SDL_ANDROID_drawTouchscreenKeyboard();
SDL_ANDROID_processAndroidTrackballDampening();
}
if( ! (*JavaEnv)->CallIntMethod( JavaEnv, JavaRenderer, JavaSwapBuffers ) )
return 0;
if( glContextLost )
@@ -81,7 +84,6 @@ int SDL_ANDROID_CallJavaSwapBuffers()
__android_log_print(ANDROID_LOG_INFO, "libSDL", "OpenGL context recreated, refreshing textures");
SDL_ANDROID_VideoContextRecreated();
appRestoredCallback();
SDL_PrivateAppActive(1, SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
}
return 1;
}
@@ -120,6 +122,13 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeGlContextLost) ( JNIEnv* env, jobject thiz
SDL_ANDROID_VideoContextLost();
}
JNIEXPORT void JNICALL
JAVA_EXPORT_NAME(DemoRenderer_nativeGlContextRecreated) ( JNIEnv* env, jobject thiz )
{
__android_log_print(ANDROID_LOG_INFO, "libSDL", "OpenGL context recreated, sending SDL_ACTIVEEVENT");
SDL_PrivateAppActive(0, SDL_APPACTIVE|SDL_APPINPUTFOCUS|SDL_APPMOUSEFOCUS);
}
JNIEXPORT void JNICALL
JAVA_EXPORT_NAME(DemoRenderer_nativeInitJavaCallbacks) ( JNIEnv* env, jobject thiz )
{