From 29e2d9db80e31003e9d58db986ee0966ec844df8 Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Sun, 25 Sep 2022 19:05:56 -0400 Subject: 3D Chunks rendering --- engine/xe_engine.cpp | 8 +++++++- engine/xe_engine.hpp | 3 +++ engine/xe_game_object.hpp | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'engine') 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 loadModelFromFile(const std::string &filename); std::shared_ptr loadModelFromData(std::vector vertexData, uint32_t vertexSize, std::vector 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{}; - glm::vec3 color{}; + // glm::vec3 color{}; TransformComponent transform; private: -- cgit v1.2.3-freya