-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.cpp
More file actions
60 lines (49 loc) · 1.33 KB
/
app.cpp
File metadata and controls
60 lines (49 loc) · 1.33 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
#include "Engine/Camera.hpp"
#include "Engine/Engine.hpp"
#include "Engine/Object.hpp"
#include "Engine/Render/Font.hpp"
#include "Engine/Render/Material.hpp"
#include "Engine/Render/Mesh.hpp"
#include "Engine/Render/Texture.hpp"
#include "Engine/Resource/ResourceManager.hpp"
#include "Engine/UI/Text.hpp"
#include "Engine/Utils/Timer.hpp"
#include "Engine/Utils/Util.hpp"
#include "Engine/Window/Window.hpp"
#include "Engine/Utils/Random.hpp"
#include "Engine/World.hpp"
#include "GLFW/glfw3.h"
#include <glad/glad.h>
#include <glm/glm.hpp>
#include <memory>
#include <iostream>
#include <vector>
#include <chrono>
#include "Game/Game.hpp"
#include "Globals.hpp"
#include "glm/ext/matrix_transform.hpp"
int main(int argc, const char** argv)
{
if(EngineInit() == -1) return -1;
Random::Init();
std::shared_ptr<Window> window(Window::Create(800, 600, "Racing game"));
window->MakeCurrent();
EngineInitGLAD();
window->Init();
// block so it cleans resources before EngineClean()
{
Game game(window);
Timer timer;
timer.Start();
window->SetRenderCallback([&]() -> bool {
float delta = timer.Tick();
game.Tick(delta);
game.Render();
return false;
});
window->Render();
}
// game.Clean();
EngineClean();
return 0;
}