forked from mashakos/OmniScaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
43 lines (31 loc) · 889 Bytes
/
main.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
#include "OmniScalerSystem.h"
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
OmniScalerSystem* System;
bool result;
// Create the system object.
System = new OmniScalerSystem;
if (!System)
{
return 0;
}
LPWSTR *szArgList;
int argCount;
wchar_t *CommandLineW;
int len = MultiByteToWideChar(CP_UTF8, 0, pScmdline, strlen(pScmdline), NULL, 0);
CommandLineW = new wchar_t[len + 1];
MultiByteToWideChar(CP_UTF8, 0, pScmdline, strlen(pScmdline), CommandLineW, len);
CommandLineW[len] = '\0';
szArgList = CommandLineToArgvW(CommandLineW, &argCount);
// Initialize and run the system object.
result = System->InitScaler(hInstance, argCount, *szArgList, CommandLineW);
if (result)
{
System->MainLoop();
}
// Shutdown and release the system object.
System->Shutdown();
delete System;
System = 0;
return 0;
}