Rumah > Soal Jawab > teks badan
第一张是在win32下运行的结果,第二张实在android下运行的结果
按照屏幕适配的教程我写了如下代码
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::create("My Game");
director->setOpenGLView(glview);
glview->setDesignResolutionSize(960,640,ResolutionPolicy::SHOW_ALL);
}
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
register_all_packages();
// create a scene. it's an autorelease object
auto scene = MainScene1::createScene();
// run
director->runWithScene(scene);
return true;
}
请问哪里出错了?
网上有教程说要修改main.cpp,
void cocos_android_app_init (JNIEnv* env, jobject thiz) {
LOGD("cocos_android_app_init");
AppDelegate *pAppDelegate = new AppDelegate();
}
可是我的cocos2dx是3.5版本的,和我找的所有教程里的main.cpp都不一致。
请问应该如何写?