mirror of https://github.com/axmolengine/axmol.git
Merge pull request #6016 from samuele3hu/develop_test
Modify lua project setting and replace NativeActivity with Cocos2dActivity
This commit is contained in:
commit
b028c29a7d
|
@ -10,7 +10,7 @@
|
|||
<application android:label="@string/app_name"
|
||||
android:icon="@drawable/icon">
|
||||
|
||||
<activity android:name=".Cocos2dxActivity"
|
||||
<activity android:name=".AppActivity"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
using namespace cocos2d;
|
||||
|
||||
void cocos_android_app_init (struct android_app* app) {
|
||||
void cocos_android_app_init (JNIEnv* env, jobject thiz) {
|
||||
LOGD("cocos_android_app_init");
|
||||
AppDelegate *pAppDelegate = new AppDelegate();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package org.cocos2dx.lua_empty_test;
|
||||
|
||||
import org.cocos2dx.lib.Cocos2dxActivity;
|
||||
|
||||
public class AppActivity extends Cocos2dxActivity {
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package org.cocos2dx.lua_empty_test;
|
||||
|
||||
import android.app.NativeActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class Cocos2dxActivity extends NativeActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//For supports translucency
|
||||
|
||||
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
|
||||
/*const EGLint attribs[] = {
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
//EGL_BLUE_SIZE, 5, -->delete
|
||||
//EGL_GREEN_SIZE, 6, -->delete
|
||||
//EGL_RED_SIZE, 5, -->delete
|
||||
EGL_BUFFER_SIZE, 32, //-->new field
|
||||
EGL_DEPTH_SIZE, 16,
|
||||
EGL_STENCIL_SIZE, 8,
|
||||
EGL_NONE
|
||||
};*/
|
||||
|
||||
//2.Set the format of window
|
||||
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
|
||||
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
<application android:label="@string/app_name"
|
||||
android:icon="@drawable/icon">
|
||||
|
||||
<activity android:name=".Cocos2dxActivity"
|
||||
<activity android:name=".AppActivity"
|
||||
android:label="@string/app_name"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
using namespace cocos2d;
|
||||
|
||||
void cocos_android_app_init (struct android_app* app) {
|
||||
void cocos_android_app_init (JNIEnv* env, jobject thiz) {
|
||||
LOGD("cocos_android_app_init");
|
||||
AppDelegate *pAppDelegate = new AppDelegate();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
package org.cocos2dx.lua_tests;
|
||||
|
||||
import org.cocos2dx.lib.Cocos2dxActivity;
|
||||
|
||||
public class AppActivity extends Cocos2dxActivity{
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package org.cocos2dx.lua_tests;
|
||||
|
||||
import android.app.NativeActivity;
|
||||
import android.os.Bundle;
|
||||
|
||||
public class Cocos2dxActivity extends NativeActivity{
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
//For supports translucency
|
||||
|
||||
//1.change "attribs" in cocos\2d\platform\android\nativeactivity.cpp
|
||||
/*const EGLint attribs[] = {
|
||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
//EGL_BLUE_SIZE, 5, -->delete
|
||||
//EGL_GREEN_SIZE, 6, -->delete
|
||||
//EGL_RED_SIZE, 5, -->delete
|
||||
EGL_BUFFER_SIZE, 32, //-->new field
|
||||
EGL_DEPTH_SIZE, 16,
|
||||
EGL_STENCIL_SIZE, 8,
|
||||
EGL_NONE
|
||||
};*/
|
||||
|
||||
//2.Set the format of window
|
||||
// getWindow().setFormat(PixelFormat.TRANSLUCENT);
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue