-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
78 lines (61 loc) · 1.79 KB
/
Copy pathmain.cpp
File metadata and controls
78 lines (61 loc) · 1.79 KB
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
72
73
74
75
76
77
78
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#undef min
#undef max
#include <Shlwapi.h>
#include "DX12Lib/Application.h"
#include "App2/App2.h"
#include "App3/App3.h"
#include "external/nv-api/nvapi.h"
#include <dxgidebug.h>
#pragma comment(lib, "d3d12.lib")
#pragma comment(lib, "DXGI.lib")
#pragma comment(lib, "Shlwapi.lib") // PathRemoveFileSpecW()
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "D3DCompiler.lib")
#pragma comment(lib, "external/nv-api/amd64/nvapi64.lib")
void ReportLiveObjects()
{
//later IDXGIDebug1* dxgiDebug;
//later DXGIGetDebugInterface1(0, IID_PPV_ARGS(&dxgiDebug));
//later dxgiDebug->ReportLiveObjects(DXGI_DEBUG_ALL, DXGI_DEBUG_RLO_IGNORE_INTERNAL);
//later dxgiDebug->Release();
}
extern bool g_NVAPI_enabled;
int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR lpCmdLine, int nCmdShow)
{
void Mock12Test();
Mock12Test();
int retCode = 0;
// Set the working directory to the path of the executable.
WCHAR path[MAX_PATH];
HMODULE hModule = GetModuleHandleW(NULL);
if ( GetModuleFileNameW(hModule, path, MAX_PATH) > 0 )
{
PathRemoveFileSpecW(path);
SetCurrentDirectoryW(path);
}
NvAPI_Status NvapiStatus = NvAPI_Initialize();
if (NvapiStatus != NVAPI_OK)
{
printf("NVAPI ERROR %d\n", NvapiStatus);
}
else
{
g_NVAPI_enabled = true;
}
Application::Create(hInstance);
{
// std::shared_ptr<App2> demo = std::make_shared<App2>();
std::shared_ptr<App3> demo = std::make_shared<App3>();
retCode = Application::Get().Run(demo);
}
Application::Destroy();
if (NvapiStatus == NVAPI_OK)
{
NvAPI_Unload();
g_NVAPI_enabled = false;
}
atexit(&ReportLiveObjects);
return retCode;
}