使用cocos2dx 3.0的RenderTexture有概率报错

本来按网上示例用RenderTexture截屏作为暂停菜单的背景,不过总是报错,有大神知道为什么吗?

关键代码:

bool TutorialSence::init()
{
if (!Layer::init())
{
return false;
}

...

auto visibleSize = Director::getInstance()->getVisibleSize();
auto origin = Director::getInstance()->getVisibleOrigin();
...
mRenderTexture =  RenderTexture::create(visibleSize.width, visibleSize.height, Texture2D::PixelFormat::RGBA8888);
mRenderTexture->retain();

return true;

}

void TutorialSence::onKeyReleased(EventKeyboard::KeyCode keyCode, Event* event) {
switch (keyCode) {
case EventKeyboard::KeyCode::KEY_BACKSPACE:
onMenuItemSelectedWithTag(TUTORIAL_TAG_MENU);
break;
}
}

void TutorialSence::onMenuItemSelected(Ref* pSender) {
onMenuItemSelectedWithTag(((Node *)pSender)->getTag());
}

void TutorialSence::onMenuItemSelectedWithTag(int tag) {
switch (tag) {
case TUTORIAL_TAG_MENU:
auto visibleSize = Director::getInstance()->getVisibleSize();
auto origin = Director::getInstance()->getVisibleOrigin();
mRenderTexture->beginWithClear(0.0f, 0.0f, 0.0f, 0.0f);
getParent()->visit();
mRenderTexture->end();
auto _schedule = getParent()->getScheduler();
_schedule->schedule(schedule_selector(TutorialSence::onCatchImage), this, 0.0f,0,0.f, false);
break;
}
}

void TutorialSence::onCatchImage(float dt) {
// Director::getInstance()->pushScene(GameMenuSence::createScene(mRenderTexture));
}

报错的函数栈如下:

TowerDefense.exe!cocos2d::GLProgram::use() 行 370 C++
TowerDefense.exe!cocos2d::QuadCommand::useMaterial() 行 122 C++
TowerDefense.exe!cocos2d::Renderer::drawBatchedQuads() 行 474 C++
TowerDefense.exe!cocos2d::Renderer::flush() 行 506 C++
TowerDefense.exe!cocos2d::Renderer::visitRenderQueue(const cocos2d::RenderQueue & queue) 行 314 C++
TowerDefense.exe!cocos2d::Renderer::visitRenderQueue(const cocos2d::RenderQueue & queue) 行 309 C++
TowerDefense.exe!cocos2d::Renderer::render() 行 350 C++
TowerDefense.exe!cocos2d::Director::drawScene() 行 312 C++
TowerDefense.exe!cocos2d::DisplayLinkDirector::mainLoop() 行 1101 C++
TowerDefense.exe!cocos2d::Application::run() 行 92 C++
TowerDefense.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) 行 17 C++
TowerDefense.exe!__tmainCRTStartup() 行 528 C
TowerDefense.exe!wWinMainCRTStartup() 行 377 C
kernel32.dll!761e336a() 未知
下面的框架可能不正确和/或缺失,没有为 kernel32.dll 加载符号]
ntdll.dll!76f99f72() 未知
ntdll.dll!76f99f45() 未知

我是楼主的马甲

额 没人管我就当是3.0的Bug了,反正改了CCQuadCommand.cpp以后就没问题了

我的也会这样的 不知道什么原因 郁闷 有概率的发生

请问楼主是怎么解决的?

请问怎么改CCQuadCommand.cpp

请问是如何修改CCQuadCommand.cpp 的、、、 升级到3.1版本吗??