-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
41 lines (34 loc) · 1 KB
/
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
#include <iostream>
#include <SDL.h>
#include <imgui_impl_opengl3.h>
#include <imgui_impl_opengl3_loader.h>
#include <imgui_impl_sdl.h>
#include "imgui.h"
#include "src/view/Renderer.h"
#include "plog/Severity.h"
#include "plog/Initializers/RollingFileInitializer.h"
#include "src/view_model/MainViewModel.h"
#include "plog/Log.h"
#include "src/model/user/Config.h"
int main() {
plog::init(plog::debug, "DebugLog.txt");
// Here should be your config file.
Config::init("resources/config.cfg");
try {
Renderer renderer;
MainView mainView(renderer);
MainViewModel mainViewModel(mainView);
bool show_demo_window = true;
while (renderer.isInLoop()) {
renderer.preFrame();
if (show_demo_window) {
ImGui::ShowDemoWindow(&show_demo_window);
}
mainViewModel.onFrame();
renderer.postFrame();
}
} catch (const std::exception& e) {
PLOG_ERROR << e.what();
}
return 0;
}