找到项目里的 $(projectDir)/proj.win32/main.cpp
宏定义里声明如下:
1
|
#define USE_WIN32_CONSOLE
|
int
APIENTRY
_tWinMain
(
HINSTANCE
hInstance
,
HINSTANCE
hPrevInstance
,
LPTSTR
lpCmdLine
,
int
nCmdShow
)
{
UNREFERENCED_PARAMETER
(
hPrevInstance
)
;
UNREFERENCED_PARAMETER
(
lpCmdLine
)
;
// alloc一个console
#ifdef USE_WIN32_CONSOLE
AllocConsole
(
)
;
freopen
(
"CONIN$"
,
"r"
,
stdin
)
;
freopen
(
"CONOUT$"
,
"w"
,
stdout
)
;
freopen
(
"CONOUT$"
,
"r"
,
stderr
)
;
#endif
// create the application instance
AppDelegate
app
;
CCEGLView
*
eglView
=
CCEGLView
::
sharedOpenGLView
(
)
;
eglView
->
setViewName
(
"zombie"
)
;
eglView
->
setFrameSize
(
w
,
h
)
;
int
ret
=
CCApplication
::
sharedApplication
(
)
->
run
(
)
;
// 释放 console
#ifdef USE_WIN32_CONSOLE
fclose
(
stderr
)
;
fclose
(
stdout
)
;
fclose
(
stdin
)
;
FreeConsole
(
)
;
#endif
return
ret
;
}
|