Merge pull request #6265 from sachingarg05/AndroidJavaActivityOrientation

Fix Orientation Change Support for Android Java Activity
This commit is contained in:
minggo 2014-04-14 09:50:15 +08:00
commit 6ab462ccf0
2 changed files with 8 additions and 0 deletions

View File

@ -75,6 +75,7 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer {
@Override
public void onSurfaceChanged(final GL10 pGL10, final int pWidth, final int pHeight) {
Cocos2dxRenderer.nativeOnSurfaceChanged(pWidth, pHeight);
}
@Override
@ -118,6 +119,7 @@ public class Cocos2dxRenderer implements GLSurfaceView.Renderer {
private static native boolean nativeKeyDown(final int pKeyCode);
private static native void nativeRender();
private static native void nativeInit(final int pWidth, final int pHeight);
private static native void nativeOnSurfaceChanged(final int pWidth, final int pHeight);
private static native void nativeOnPause();
private static native void nativeOnResume();

View File

@ -79,4 +79,10 @@ void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jobject thi
}
void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeOnSurfaceChanged(JNIEnv* env, jobject thiz, jint w, jint h)
{
cocos2d::Application::getInstance()->applicationScreenSizeChanged(w, h);
}
}