-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
71 lines (61 loc) · 2.31 KB
/
main.cpp
File metadata and controls
71 lines (61 loc) · 2.31 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
//Author: DOYEONG LEE
//Second Author: JEYOON YU
//Project: CubeEngine
//File: main.cpp
#include "Engine.hpp"
#include "VerticesDemo.hpp"
#include "ProceduralMeshes.hpp"
#include "3DPhysicsDemo.hpp"
#include "PocketBallDemo/PocketBallDemo.hpp"
#include "PlatformDemo/PlatformDemo.hpp"
#include "BeatEmUpDemo/BeatEmUpDemo.hpp"
#include "PBR.hpp"
#include "MultipleLights.hpp"
#include "SkeletalAnimationDemo.hpp"
#include "DebugTools.hpp"
// DirectX 12 Agility SDK Setup
#if USE_PREVIEW_SDK
#define AGILITY_SDK_VER 715 // Use 1.715.0-preview SDK for Mesh Nodes
#else
#define AGILITY_SDK_VER 618 // Use 1.618.4 SDK for Work Graphs
#endif
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
// DirectX 12 Agility SDK 1.715.0-preview or later is required for Mesh Nodes
extern "C" { __declspec(dllexport) extern const UINT D3D12SDKVersion = AGILITY_SDK_VER; }
extern "C" { __declspec(dllexport) extern const char* D3D12SDKPath = ".\\D3D12\\"; }
#undef main
int main(void)
{
#ifdef _DEBUG
DebugTools::EnableMemoryLeakDetection();
DebugTools::EnableWriteDump();
#endif
try
{
Engine& engine = Engine::Instance();
engine.Init("CubeEngine", 1280, 720, false, WindowMode::NORMAL);
engine.SetFPS(FrameRate::FPS_144);
//engine.GetSoundManager().LoadSoundFilesFromFolder(L"..\\Game\\assets\\Musics");
engine.GetSoundManager().LoadSoundFilesFromFolder("../Game/assets/Sounds");
engine.GetGameStateManager().AddLevel(new ProceduralMeshes);
engine.GetGameStateManager().AddLevel(new VerticesDemo);
engine.GetGameStateManager().AddLevel(new PhysicsDemo);
engine.GetGameStateManager().AddLevel(new PocketBallDemo);
engine.GetGameStateManager().AddLevel(new PlatformDemo);
engine.GetGameStateManager().AddLevel(new BeatEmUpDemo);
engine.GetGameStateManager().AddLevel(new PBR);
engine.GetGameStateManager().AddLevel(new MultipleLights);
engine.GetGameStateManager().AddLevel(new SkeletalAnimationDemo);
engine.GetGameStateManager().LevelInit(GameLevel::PROCEDURALMESHES);
engine.Update();
engine.End();
}
catch (const std::runtime_error& e)
{
std::cerr << "The engine has stopped due to a fatal error\n";
std::cerr << "Error: " << e.what() << std::endl;
return -1;
}
return 0;
}