Karma Engine
Loading...
Searching...
No Matches
EntryPoint.h
1#pragma once
2#include "Karma.h"
3
4// Karma's entry point
5
6// If we are on Windows
7#ifdef KR_WINDOWS_PLATFORM
8
9// CreateApplication should be implemented in client
10extern Karma::Application* Karma::CreateApplication();
11
12int main(int argc, char** argv)
13{
14 // TODO: add engine initialization code for various systems
15 Karma::Log::Init();
16 Karma::RenderCommand::Init();
17 KR_INFO("Hello Cowboy. Your lucky number is {0}", 7);
18
19 auto app = Karma::CreateApplication();
20
21 Karma::Input::Init();
22
23 app->PrepareApplicationForRun();
24 app->Run();
25
26 delete app;
27
28 Karma::RenderCommand::DeInit();
29 Karma::Input::DeInit();
30
31 return 0;
32}
33
34// If we are on Linux
35#elif defined KR_LINUX_PLATFORM
36
37// CreateApplication should be implemented in client
38extern Karma::Application* Karma::CreateApplication();
39
40int main(int argc, char** argv)
41{
42 // TODO: add engine initialization code for various systems
43 Karma::Log::Init();
44 Karma::RenderCommand::Init();
45 KR_INFO("Hello Cowboy. Your lucky number is {0}", 7);
46
47 auto app = Karma::CreateApplication();
48
49 Karma::Input::Init();
50
51 app->PrepareApplicationForRun();
52 app->Run();
53
54 delete app;
55
56 Karma::RenderCommand::DeInit();
57 Karma::Input::DeInit();
58
59 return 0;
60}
61
62// If we are on Mac
63#elif defined KR_MAC_PLATFORM
64
65// CreateApplication should be implemented in client
66extern Karma::Application* Karma::CreateApplication();
67
68int main(int argc, char** argv)
69{
70 // TODO: add engine initialization code for various systems
71 Karma::Log::Init();
72 Karma::RenderCommand::Init();
73 KR_INFO("Hello Cowboy. Your lucky number is {0}", 7);
74
75 auto app = Karma::CreateApplication();
76
77 Karma::Input::Init();
78
79 app->PrepareApplicationForRun();
80 app->Run();
81 delete app;
82
83 Karma::RenderCommand::DeInit();
84 Karma::Input::DeInit();
85
86 return 0;
87}
88
89#endif
Definition Application.h:24