diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/xe_engine.cpp | 8 | ||||
-rw-r--r-- | engine/xe_engine.hpp | 3 | ||||
-rw-r--r-- | engine/xe_game_object.hpp | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/engine/xe_engine.cpp b/engine/xe_engine.cpp index f28bbce..37cba41 100644 --- a/engine/xe_engine.cpp +++ b/engine/xe_engine.cpp @@ -2,6 +2,12 @@ namespace xe { +static Engine* _instance; + +Engine* Engine::getInstance() { + return _instance; +} + Engine::Engine(int width, int height, std::string name) : xeWindow{width, height, name}, xeDevice{xeWindow}, xeRenderer{xeWindow, xeDevice}, @@ -9,8 +15,8 @@ Engine::Engine(int width, int height, std::string name) : xeWindow{width, height xeInput{xeWindow} { loadDescriptorPool(); alutInit(0, NULL); - std::cout << "Audio device: " << alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER) << "\n"; + _instance = this; }; Engine::~Engine() { diff --git a/engine/xe_engine.hpp b/engine/xe_engine.hpp index 28974cb..dc534ea 100644 --- a/engine/xe_engine.hpp +++ b/engine/xe_engine.hpp @@ -29,6 +29,7 @@ class Engine { Input& getInput() {return xeInput;} Camera& getCamera() {return xeCamera;} + Device& getDevice() {return xeDevice;} std::shared_ptr<Model> loadModelFromFile(const std::string &filename); std::shared_ptr<Model> loadModelFromData(std::vector<float> vertexData, uint32_t vertexSize, std::vector<uint32_t> indices); @@ -41,6 +42,8 @@ class Engine { bool poll(); float getFrameTime() { return frameTime; } + static Engine* getInstance(); + private: void loadDescriptorPool(); diff --git a/engine/xe_game_object.hpp b/engine/xe_game_object.hpp index 30625f1..7c4149e 100644 --- a/engine/xe_game_object.hpp +++ b/engine/xe_game_object.hpp @@ -38,7 +38,7 @@ class GameObject { id_t getId() { return id; } std::shared_ptr<Model> model{}; - glm::vec3 color{}; + // glm::vec3 color{}; TransformComponent transform; private: |