cocos2d-x lua 在vs上分离控制台输出

在项目中搜索 main.cpp 然后复制下面代码替换即可
#include "main.h"
//#include "SimulatorWin.h"
#include "AppDelegate.h"
//#include <shellapi.h>
USING_NS_CC;
#define USE_WIN32_CONSOLE

int WINAPI _tWinMain(HINSTANCE hInstance,
	HINSTANCE hPrevInstance,
	LPTSTR    lpCmdLine,
	int       nCmdShow)
{
	UNREFERENCED_PARAMETER(hPrevInstance);
	UNREFERENCED_PARAMETER(lpCmdLine);

#ifdef USE_WIN32_CONSOLE
	AllocConsole();
	freopen("CONIN$", "r", stdin);
	freopen("CONOUT$", "w", stdout);
	freopen("CONOUT$", "w", stderr);
#endif

	//auto simulator = SimulatorWin::getInstance();
	//return simulator->run();
	AppDelegate app;
	int ret = Application::getInstance()->run();
#ifdef USE_WIN32_CONSOLE
	FreeConsole();
#endif

	return ret;
}

猜你喜欢

转载自blog.csdn.net/ding_westbrook/article/details/79572093
今日推荐