最近項目中要用到AR 解決了好幾天 今天終于迎來了喜報。
先說easyAR
如果ARviewcontroller
繼承GLKViewController
會報野指針
23232323.png
如果繼承Viewcontroller
就是 黑屏
但是在原生項目中 是沒有問題的 集成在cocos2dx就會出現這樣的問題
目前猜想是easyAR openGL
和cocos
沖突的原因吧。
Vuforia
是國外SDK
比easyAR 麻煩點
同樣集成在cocos 中會報錯誤LOG
This application is modifying the autolayout engine from a background thread
猜想可能是 rootviewcontroller
線程和當前沖突了
于是在rootcontroller里加上
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
cocos2d::Director::getInstance()->resume();
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
cocos2d::Director::getInstance()->pause();
}
目前easyAR 問題還沒解決,總體來說 還是覺得 easy好用 解決中...有問題會及時分享出來