37 lines
715 B
C++
37 lines
715 B
C++
#include "../../base/HGDef.h"
|
|
#include "../../base/HGInc.h"
|
|
#include "../../base/HGThread.h"
|
|
#include "MsgLoop.h"
|
|
|
|
static void ThreadFunc(HGThread thread, HGPointer param)
|
|
{
|
|
(void)thread;
|
|
(void)param;
|
|
|
|
MsgLoop* loop = (MsgLoop*)param;
|
|
loop->Loop();
|
|
}
|
|
|
|
#if defined(HG_CMP_MSC)
|
|
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE iPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
|
|
#else
|
|
int main()
|
|
#endif
|
|
{
|
|
#if defined(HG_CMP_MSC)
|
|
WSADATA ws = { 0 };
|
|
int ret = WSAStartup(MAKEWORD(2, 2), &ws);
|
|
assert(0 == ret);
|
|
#endif
|
|
|
|
MsgLoop loop;
|
|
HGThread thread = NULL;
|
|
HGBase_OpenThread(ThreadFunc, &loop, &thread);
|
|
HGBase_CloseThread(thread);
|
|
thread = NULL;
|
|
|
|
#if defined(HG_CMP_MSC)
|
|
WSACleanup();
|
|
#endif
|
|
return 0;
|
|
} |