-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path25940p.cpp
71 lines (50 loc) · 1.88 KB
/
25940p.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "stdafx.h"
#include "resource.h"
#include "swArchive.h"
#include "swStageStack.h"
#include "swGeometry.h"
#include "../stge/stge/stge.h"
#include "../stge/stge/par_yard.h"
//#define LOAD_SCRIPT_FROM_SCRIPT_CODE
#ifdef LOAD_SCRIPT_FROM_SCRIPT_CODE
#include "p25940.cpp" // Generate p25940.cpp from 25940.stge by stge::CodeGenerator.
#else
#include "p25940.c" // Generate p25940.c from p25940.zip(25940.stge) as uchar array P25940_MOD by bin2c tool.
#endif
#include "AtlOpengl.h"
#include "MainFrm.h"
CAppModule _Module;
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
CGLMessageLoop theLoop;
_Module.AddMessageLoop(&theLoop);
CMainFrame wndMain;
if(wndMain.CreateEx() == NULL)
{
ATLTRACE(_T("Main window creation failed!\n"));
return 0;
}
wndMain.ShowWindow(nCmdShow);
timeBeginPeriod(1) ;
int nRet = theLoop.Run();
timeEndPeriod(1) ;
_Module.RemoveMessageLoop();
return nRet;
}
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{
HRESULT hRes = ::CoInitialize(NULL);
// If you are running on NT 4.0 or higher you can use the following call instead to
// make the EXE free threaded. This means that calls come in on a random RPC thread.
// HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
ATLASSERT(SUCCEEDED(hRes));
// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
::DefWindowProc(NULL, 0, 0, 0L);
AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls
hRes = _Module.Init(NULL, hInstance);
ATLASSERT(SUCCEEDED(hRes));
int nRet = Run(lpstrCmdLine, nCmdShow);
_Module.Term();
::CoUninitialize();
return nRet;
}