📄 winmain32.cc
字号:
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
#include "platformWin32/platformWin32.h"
#include "platform/platform.h"
//#include "platform/platformIME.h"//IME
//#include "platformWin32/platformGL.h"
//#include "platform/platformVideo.h"
//#include "platformWin32/winOGLVideo.h"
//#include "platformWin32/winD3DVideo.h"
//#include "platformWin32/winV2Video.h"
#include "platform/event.h"
//#include "console/console.h"
//#include "platformWin32/winConsole.h"
//#include "platformWin32/winDirectInput.h"
#include "platform/gameInterface.h"
//#include "math/mRandom.h"
//#include "core/fileStream.h"
//#include "game/resource.h"
//#include "core/unicode.h"
//
////-------------------------------------- Resource Includes
//#include "dgl/gBitmap.h"
#include "dgl/gFont.h"
extern void createFontInit();
extern void createFontShutdown();
extern bool LinkConsoleFunctions;
//--------------------------------------
static S32 run(S32 argc, const char **argv)
{
// Console hack to ensure consolefunctions get linked in
LinkConsoleFunctions=true;
createFontInit();
//windowSize.set(0,0);
S32 ret = Game->main(argc, argv);
createFontShutdown();
return ret;
}
//--------------------------------------
S32 main(S32 argc, const char **argv)
{
winState.appInstance = GetModuleHandle(NULL);
return run(argc, argv);
}
//--------------------------------------
S32 PASCAL WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, S32)
{
Vector<char *> argv;
char moduleName[256];
GetModuleFileNameA(NULL, moduleName, sizeof(moduleName));
argv.push_back(moduleName);
for (const char* word,*ptr = lpszCmdLine; *ptr; ) {
// Eat white space
for (; dIsspace(*ptr) && *ptr; ptr++)
;
// Pick out the next word
for (word = ptr; !dIsspace(*ptr) && *ptr; ptr++)
;
// Add the word to the argument list.
if (*word) {
int len = ptr - word;
char *arg = (char *) dMalloc(len + 1);
dStrncpy(arg, word, len);
arg[len] = 0;
argv.push_back(arg);
}
}
winState.appInstance = hInstance;
S32 retVal = run(argv.size(), (const char **) argv.address());
for(U32 j = 1; j < argv.size(); j++)
dFree(argv[j]);
return retVal;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -