mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6265 from sachingarg05/AndroidJavaActivityOrientation
Fix Orientation Change Support for Android Java Activity
This commit is contained in:
commit
6ab462ccf0
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue