截图不全及修复方法讨论

问题:
(cocos-2d-x 版本: 3.3 beta,其它版本没测试)

   场景中加入自定义的绘制对象后(比如图像、线段、圆等,这些对象直接从Node派生), 
   调用 utils::captureScreen 截图, 保存出来的截图只有这些自定义的绘制对象, 

场景中的标签和按钮都没有抓出来。

疑问:是用法不对(比如 gl es 上下文环境或者shader没恢复好)? 还是 cocos 本身有 bug ?

解决方法:(讨论这种下面方法是否合适,是不是有更好的解决办法)

     captureScreenCommand不加入RenderQueue,即时调用onCaptureScreen执行glReadPixels并保存出来。 

void captureScreen(const std::function<void(bool, const std::string&)>& afterCaptured, const std::string& filename)
{
static CustomCommand captureScreenCommand;
captureScreenCommand.setTransparent(true);
captureScreenCommand.init(std::numeric_limits::max());
captureScreenCommand.func = std::bind(onCaptureScreen, afterCaptured, filename);
----- //Director::getInstance()->getRenderer()->addCommand(&captureScreenCommand);
+++ onCaptureScreen(afterCaptured, filename);
}

=== 另外,对于win32 平台,在glReadPixels之前调用 glReadBuffer(GL_FRONT);
不用作如上修改,截图也正确。