您的位置:首页 > 移动开发 > Cocos引擎

cocos2dx- call to OpenGL ES API with no current context(logged once per thread)

2015-01-22 10:02 543 查看
can not invoke OpenGL es functions in new thread.

要在opengl es 的线程里面调用

例如原来你的游戏代码是:
native public void buySuccess(int realIndex);


现在你需要这么操作,让调用再open gl 处理,代码如下:
public void buySuccessJava(final int realIndex)
{
Cocos2dxGLSurfaceView.getInstance().queueEvent(new Runnable() {
@Override
public void run() {
buySuccess(realIndex);
}
});
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  cocos2dx opengl
相关文章推荐