Raftel Engine
 
Loading...
Searching...
No Matches
engine.hpp
1// Engine.hpp / Singleton
2#ifndef __ENGINE_HPP__
3#define __ENGINE_HPP__ 1
4
5#include <vector>
6#include <string.h>
7#include <unordered_map>
8#include "raftel/imguiRenderer.hpp"
9//#include "raftel/ecs.hpp"
10
11namespace Raftel {
12 class Mesh;
13 class Entity;
14 class Engine {
15 public:
16
17 static Engine& Instance() {
18 static Engine instance;
19 return instance;
20 }
21
22 std::string getFileName(const std::string& path) {
23 size_t lastSlashPos = path.find_last_of("/");
24 if (lastSlashPos != std::string::npos) {
25 return path.substr(lastSlashPos + 1);
26 }
27 return path;
28 }
29
30 std::vector<std::shared_ptr<Raftel::Mesh>> meshes;
31 std::vector<std::shared_ptr<Raftel::Mesh>> internalMeshes;
32 std::vector<std::shared_ptr<Raftel::Entity>> lights;
33 std::vector<std::shared_ptr<Raftel::Entity>> point_lights;
34 std::vector<std::shared_ptr<Raftel::Entity>> spot_lights;
35 int numLights;
36 int numEntities;
37
38
39 int has_ambient_light = TRUE;
40 glm::vec3 ambient_light = glm::vec3(0.1f, 0.1f, 0.1f);
41
42 float SCREEN_W;
43 float SCREEN_H;
44 int selectedEntity;
45 private:
46 Engine() : numLights(0), numEntities(0),selectedEntity(-1), SCREEN_W(1280.0f), SCREEN_H(720.0f) {}
47 ~Engine() {}
48
49 Engine(const Engine&) = delete;
50 Engine& operator=(const Engine&) = delete;
51 };
52}
53
54#endif // ENGINE_HPP
Represents an entity in the ECS (Entity Component System).
Definition ecs.hpp:28
Represents a 3D mesh, including vertex data, indices, and materials.
Definition mesh.hpp:89