cocos2d-x 实现printf 输出结果,方便调试。
在代理函数 bool AppDelegate::applicationDidFinishLaunching() 里开头添加以下代码:
_tsetlocale(LC_ALL,_T("")); ::AllocConsole(); ::freopen("conout$","w",stdout);
别忘了加头文件 #include <tchar.h>
然后你就可以使用printf啦,哇咔咔。
在代理函数 bool AppDelegate::applicationDidFinishLaunching() 里开头添加以下代码:
_tsetlocale(LC_ALL,_T("")); ::AllocConsole(); ::freopen("conout$","w",stdout);
别忘了加头文件 #include <tchar.h>
然后你就可以使用printf啦,哇咔咔。