-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMAIN.cpp
More file actions
66 lines (46 loc) · 1.17 KB
/
MAIN.cpp
File metadata and controls
66 lines (46 loc) · 1.17 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
#include"pch.h"
#pragma comment(lib, "d3d12.lib")
#pragma comment(lib, "dxgi.lib")
#pragma comment(lib, "d3dcompiler.lib")
#pragma comment(lib, "glfw3.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "user32.lib")
#pragma comment(lib, "gdi32.lib")
#pragma comment(lib, "shell32.lib")
int main()
{
EngineTime ::Init();
Input ::Init();
Logger ::Init();
MemoryManager::Init(64 * 1024 * 1024, 32 * 1024 * 1024);
Init_Config config;
config.Window_width = 900;
config.Window_height = 900;
config.Window_title = "FLAGE_2.0";
//Window
window* Window = nullptr;
Window = MemoryManager::NewPermanent<GLFW_WINDOW>();
Window->Init(config);
config.hwnd = Window->GetHandel();
//Renderer
render* Renderer = nullptr;
Renderer = CreateDevice(API::D3D12);
Renderer->Init(config);
//Main_loop
while (!Window->ShouldClose())
{
Window->Update();
Input::Update();
float dt = EngineTime::Tick();
if (Input::IsKeyDown(GLFW_KEY_ESCAPE))
{
Window->End();
}
Renderer->Update();
MemoryManager::GetFrameArena().Reset();
}
Renderer->End();
Window->End();
MemoryManager::Shutdown();
return 0;
}