-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathEngine.h
More file actions
40 lines (30 loc) · 932 Bytes
/
Engine.h
File metadata and controls
40 lines (30 loc) · 932 Bytes
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
#pragma once
#include "Camera.h"
#include "Core/WindowSystem.h"
#include "Core/RenderSystem.h"
#include "Core/GUISystem.h"
#include <unordered_map>
#include <filesystem>
class Engine {
public:
// Initializes engine from an XML config file
explicit Engine(const std::filesystem::path& configPath);
void AddScene(const std::shared_ptr<SceneBase>& scene);
void SetActiveScene(const std::string_view sceneName);
// Load scene and run update loop
void Execute();
private:
void shutdown();
// Performs view-frustum culling.
// Returns meshes visible by the camera.
std::vector<ModelPtr> cullViewFrustum() const;
Camera m_camera;
// Core Systems
WindowSystem m_window;
RenderSystem m_renderer;
GUISystem m_guiSystem;
// All loaded scenes stored in memory
std::unordered_map<std::string, std::shared_ptr<SceneBase>> m_scenes;
// Current scene being processed by renderer
SceneBase* m_activeScene{ nullptr };
};