From 8cc0b081ef0188f850814b2af2cb077583eb9f2d Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Mon, 19 Sep 2022 21:28:41 -0400 Subject: [PATCH] finish refactor --- .env.example | 1 - Makefile | 4 +- engine/xe_engine.cpp | 68 ++++++++------------- engine/xe_engine.hpp | 44 ++++++-------- engine/xe_frame_info.hpp | 16 ----- engine/xe_render_system.cpp | 82 ++++++++++++-------------- engine/xe_render_system.hpp | 32 ++++------ res/shaders/simple_shader.vert | 2 +- res/shaders/simple_shader.vert.spv | Bin 2520 -> 2816 bytes src/first_app.cpp | 85 ++++++++------------------- src/first_app.hpp | 12 ++-- src/keyboard_movement_controller.cpp | 4 +- src/keyboard_movement_controller.hpp | 4 +- src/main.cpp | 2 +- src/simple_renderer.cpp | 26 ++++++++ src/simple_renderer.hpp | 36 ++++++++++++ 16 files changed, 195 insertions(+), 223 deletions(-) delete mode 100644 .env.example delete mode 100644 engine/xe_frame_info.hpp create mode 100644 src/simple_renderer.cpp create mode 100644 src/simple_renderer.hpp diff --git a/.env.example b/.env.example deleted file mode 100644 index d316828..0000000 --- a/.env.example +++ /dev/null @@ -1 +0,0 @@ -VULKAN_SDK=/home/tylerm/Documents/Vulkan \ No newline at end of file diff --git a/Makefile b/Makefile index 96e7b3a..561c5bf 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,9 @@ -include .env - CC = clang++ INCFLAGS = -Isrc INCFLAGS += -Iengine INCFLAGS += -Ilib/glfw/include INCFLAGS += -Ilib/glm -INCFLAGS += -L${VULKAN_SDK}/lib -lvulkan CCFLAGS = -std=c++17 -O2 -g CCFLAGS += $(INCFLAGS) @@ -15,6 +12,7 @@ LDFLAGS = -lm LDFLAGS += $(INCFLAGS) LDFLAGS += lib/glfw/src/libglfw3.a LDFLAGS += lib/glm/glm/libglm_static.a +LDFLAGS += -lvulkan SRC = $(shell find src -name "*.cpp") SRC += $(shell find engine -name "*.cpp") diff --git a/engine/xe_engine.cpp b/engine/xe_engine.cpp index 6de221a..ea54bb4 100644 --- a/engine/xe_engine.cpp +++ b/engine/xe_engine.cpp @@ -1,16 +1,14 @@ #include "xe_engine.hpp" -#include "xe_descriptors.hpp" +#include -#include namespace xe { -XeEngine::XeEngine(int width, int height, std::string name) - : xeWindow{width, height, name}, - xeDevice{xeWindow}, - xeRenderer{xeWindow, xeDevice}, - xeCamera{} { - loadDescriptors(); - }; +XeEngine::XeEngine(int width, int height, std::string name) : xeWindow{width, height, name}, + xeDevice{xeWindow}, + xeRenderer{xeWindow, xeDevice}, + xeCamera{} { + loadDescriptors(); +}; void XeEngine::loadDescriptors() { xeDescriptorPool = XeDescriptorPool::Builder(xeDevice) @@ -24,45 +22,27 @@ void XeEngine::loadDescriptors() { .build(); } -std::unique_ptr XeEngine::createRenderSystem(const std::string &vert, const std::string &frag, uint32_t pushCunstantDataSize, uint32_t uniformBufferDataSize) { - return std::make_unique( - xeDevice, - xeRenderer, - *xeDescriptorPool, - *xeDescriptorSetLayout, - vert, - frag, - pushCunstantDataSize, - uniformBufferDataSize - ); -} - -std::shared_ptr XeEngine::createModel(const std::string &filename) { +std::shared_ptr XeEngine::loadModelFromFile(const std::string &filename) { return XeModel::createModelFromFile(xeDevice, filename); } -void XeEngine::render( - XeRenderSystem& xeRenderSystem, - std::vector& gameObjects, - void* pushConstantData, - uint32_t pushConstantSize, - void* uniformBufferData, - uint32_t uniformBufferSize) { +std::shared_ptr XeEngine::loadModelFromData(std::vector vertices, std::vector indices) { + XeModel::Builder builder{}; + builder.vertices = vertices; + if(&indices == NULL) { + builder.indices = indices; + } + return std::make_shared(xeDevice, builder); +} - auto commandBuffer = xeRenderer.getCurrentCommandBuffer(); - xeRenderer.beginSwapChainRenderPass(commandBuffer); - - xeRenderSystem.renderGameObjects( - xeRenderer.getFrameIndex(), - commandBuffer, - gameObjects, - pushConstantData, - pushConstantSize, - uniformBufferData, - uniformBufferSize - ); - - xeRenderer.endSwapChainRenderPass(commandBuffer); +bool XeEngine::poll() { + glfwPollEvents(); + auto newTime = std::chrono::high_resolution_clock::now(); + frameTime = std::chrono::duration(newTime - currentTime).count(); + currentTime = newTime; + float aspect = xeRenderer.getAspectRatio(); + xeCamera.setPerspectiveProjection(glm::radians(FOV), aspect, 0.1f, 100.f); + return !xeWindow.shouldClose(); } } \ No newline at end of file diff --git a/engine/xe_engine.hpp b/engine/xe_engine.hpp index d9f79ca..d3862d4 100644 --- a/engine/xe_engine.hpp +++ b/engine/xe_engine.hpp @@ -3,8 +3,9 @@ #include "xe_window.hpp" #include "xe_device.hpp" #include "xe_renderer.hpp" -#include "xe_render_system.hpp" +#include "xe_camera.hpp" #include "xe_descriptors.hpp" +#include #include namespace xe { @@ -14,41 +15,25 @@ class XeEngine { public: XeEngine(int width, int height, std::string name); + ~XeEngine() {}; XeEngine(const XeEngine&) = delete; XeEngine operator=(const XeEngine&) = delete; - XeWindow& getWindow() { - return xeWindow; - }; + XeWindow& getWindow() {return xeWindow;} + XeCamera& getCamera() {return xeCamera;} - XeRenderer& getRenderer() { - return xeRenderer; - }; - - XeCamera& getCamera() { - return xeCamera; - }; - - std::unique_ptr createRenderSystem(const std::string &vert, const std::string &frag, uint32_t pushCunstantDataSize, uint32_t uniformBufferDataSize); - - std::shared_ptr createModel(const std::string &filename); + std::shared_ptr loadModelFromFile(const std::string &filename); + std::shared_ptr loadModelFromData(std::vector vertices, std::vector indices); bool beginFrame() { return xeRenderer.beginFrame(); } - - void endFrame() { return xeRenderer.endFrame(); } - - void render( - XeRenderSystem& xeRenderSystem, - std::vector& gameObjects, - void* pushConstantData, - uint32_t pushConstantSize, - void* uniformBufferData, - uint32_t uniformBufferSize); - + void endFrame() { xeRenderer.endFrame(); } void close() { vkDeviceWaitIdle(xeDevice.device()); } + bool poll(); + float getFrameTime() { return frameTime; } + private: void loadDescriptors(); @@ -58,8 +43,15 @@ class XeEngine { XeRenderer xeRenderer; XeCamera xeCamera; + std::chrono::_V2::system_clock::time_point currentTime; + float frameTime; + + float FOV = 50.f; + std::unique_ptr xeDescriptorPool; std::unique_ptr xeDescriptorSetLayout; + + friend class XeRenderSystem; }; } \ No newline at end of file diff --git a/engine/xe_frame_info.hpp b/engine/xe_frame_info.hpp deleted file mode 100644 index 074895d..0000000 --- a/engine/xe_frame_info.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include "xe_camera.hpp" - -#include - -namespace xe { - -struct XeFrameInfo { - int frameIndex; - float frameTime; - VkCommandBuffer commandBuffer; - XeCamera &camera; -}; - -} \ No newline at end of file diff --git a/engine/xe_render_system.cpp b/engine/xe_render_system.cpp index 8a28473..6726632 100644 --- a/engine/xe_render_system.cpp +++ b/engine/xe_render_system.cpp @@ -3,11 +3,11 @@ #include #include "xe_device.hpp" #include "xe_pipeline.hpp" -#include "xe_frame_info.hpp" #include "xe_game_object.hpp" #include "xe_swap_chain.hpp" #include "xe_renderer.hpp" #include "xe_descriptors.hpp" +#include "xe_engine.hpp" #include #include @@ -17,18 +17,15 @@ namespace xe { XeRenderSystem::XeRenderSystem( - XeDevice &device, - XeRenderer &renderer, - XeDescriptorPool &xeDescriptorPool, - XeDescriptorSetLayout &xeDescriptorSetLayout, + XeEngine &xeEngine, std::string vert, std::string frag, uint32_t pushCunstantDataSize, uint32_t uniformBufferDataSize) - : xeDevice{device} { - createUniformBuffers(xeDescriptorPool, xeDescriptorSetLayout, uniformBufferDataSize); - createPipelineLayout(xeDescriptorSetLayout, pushCunstantDataSize, uniformBufferDataSize); - createPipeline(renderer.getSwapChainRenderPass(), vert, frag); + : xeDevice{xeEngine.xeDevice}, xeRenderer{xeEngine.xeRenderer} { + createUniformBuffers(*xeEngine.xeDescriptorPool, *xeEngine.xeDescriptorSetLayout, uniformBufferDataSize); + createPipelineLayout(*xeEngine.xeDescriptorSetLayout, pushCunstantDataSize, uniformBufferDataSize); + createPipeline(xeRenderer.getSwapChainRenderPass(), vert, frag); } @@ -108,55 +105,54 @@ void XeRenderSystem::createPipeline(VkRenderPass renderPass, std::string vert, s ); } -void XeRenderSystem::renderGameObjects( - int frameIndex, - VkCommandBuffer commandBuffer, - std::vector &gameObjects, - void *pushConstantData, - uint32_t pushConstantSize, - void* uniformBufferData, - uint32_t uniformBufferSize) { - - uboBuffers[frameIndex]->writeToBuffer(uniformBufferData); - uboBuffers[frameIndex]->flush(); - - xePipeline->bind(commandBuffer); - - if(pushConstantSize > 0) { +void XeRenderSystem::loadPushConstant(void *pushConstantData, uint32_t pushConstantSize) { + if(!boundPipeline) { + xeRenderer.beginSwapChainRenderPass(xeRenderer.getCurrentCommandBuffer()); + xePipeline->bind(xeRenderer.getCurrentCommandBuffer()); + boundPipeline = true; + } + if(!boundDescriptor) { vkCmdBindDescriptorSets( - commandBuffer, + xeRenderer.getCurrentCommandBuffer(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, - &descriptorSets[frameIndex], + &descriptorSets[xeRenderer.getFrameIndex()], 0, nullptr); + boundDescriptor = true; } - - for (auto& obj: gameObjects) { - - struct PushConstant { - glm::mat4 modelMatrix; - glm::mat4 normalMatrix; - }; - - PushConstant pc = PushConstant{obj.transform.mat4(), obj.transform.normalMatrix()}; - - if(pushConstantSize > 0) { - vkCmdPushConstants( - commandBuffer, + vkCmdPushConstants( + xeRenderer.getCurrentCommandBuffer(), pipelineLayout, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, pushConstantSize, - &pc); - } + pushConstantData); +} - obj.model->bind(commandBuffer); - obj.model->draw(commandBuffer); +void XeRenderSystem::loadUniformObject(void *uniformBufferData, uint32_t uniformBufferSize) { + uboBuffers[xeRenderer.getFrameIndex()]->writeToBuffer(uniformBufferData); + uboBuffers[xeRenderer.getFrameIndex()]->flush(); +} + +void XeRenderSystem::render(XeGameObject &gameObject) { + if(!boundPipeline){ + xeRenderer.beginSwapChainRenderPass(xeRenderer.getCurrentCommandBuffer()); + xePipeline->bind(xeRenderer.getCurrentCommandBuffer()); + boundPipeline = true; } + gameObject.model->bind(xeRenderer.getCurrentCommandBuffer()); + gameObject.model->draw(xeRenderer.getCurrentCommandBuffer()); + +} + +void XeRenderSystem::stop() { + boundPipeline = false; + boundDescriptor = false; + xeRenderer.endSwapChainRenderPass(xeRenderer.getCurrentCommandBuffer()); } } \ No newline at end of file diff --git a/engine/xe_render_system.hpp b/engine/xe_render_system.hpp index 608e03a..fa56fdd 100644 --- a/engine/xe_render_system.hpp +++ b/engine/xe_render_system.hpp @@ -3,10 +3,10 @@ #include #include "xe_device.hpp" #include "xe_pipeline.hpp" -#include "xe_frame_info.hpp" #include "xe_game_object.hpp" #include "xe_descriptors.hpp" #include "xe_renderer.hpp" +#include "xe_engine.hpp" #include @@ -14,42 +14,36 @@ namespace xe { class XeRenderSystem { public: - - struct XeData{}; - + XeRenderSystem( - XeDevice &device, - XeRenderer &renderer, - XeDescriptorPool &xeDescriptorPool, - XeDescriptorSetLayout &xeDescriptorSetLayout, + XeEngine &xeEngine, std::string vert, std::string frag, uint32_t pushCunstantDataSize, uint32_t uniformBufferDataSize - ); + ); ~XeRenderSystem(); XeRenderSystem(const XeRenderSystem &) = delete; XeRenderSystem operator=(const XeRenderSystem &) = delete; - void setUnifroms(XeFrameInfo & frameInfo); - - void renderGameObjects( - int frameIndex, - VkCommandBuffer commandBuffer, - std::vector &gameObjects, - void *pushConstantData, - uint32_t pushConstantSize, - void* uniformBufferData, - uint32_t uniformBufferSize); + void loadPushConstant(void *pushConstantData, uint32_t pushConstantSize); + void loadUniformObject(void *uniformBufferData, uint32_t uniformBufferSize); + void render(XeGameObject &gameObject); + void stop(); private: + void createUniformBuffers(XeDescriptorPool &xeDescriptorPool, XeDescriptorSetLayout &xeDescriptorSetLayout, uint32_t uniformBufferDataSize); void createPipelineLayout(XeDescriptorSetLayout &xeDescriptorSetLayout, uint32_t pushCunstantDataSize, uint32_t uniformBufferDataSize); void createPipeline(VkRenderPass renderPass, std::string vert, std::string frag); + bool boundPipeline{false}; + bool boundDescriptor{false}; + XeDevice& xeDevice; + XeRenderer& xeRenderer; std::unique_ptr xePipeline; std::vector> uboBuffers; diff --git a/res/shaders/simple_shader.vert b/res/shaders/simple_shader.vert index be802f7..55b0199 100755 --- a/res/shaders/simple_shader.vert +++ b/res/shaders/simple_shader.vert @@ -26,5 +26,5 @@ void main() { float lightIntensity = AMBIENT + max(dot(normalWorldSpace, ubo.directionToLight), 0); - fragColor = lightIntensity * color; + fragColor = lightIntensity * vec3(1/position.y,position.y,clamp(sin(position.x - position.z), 0, 1)); } \ No newline at end of file diff --git a/res/shaders/simple_shader.vert.spv b/res/shaders/simple_shader.vert.spv index 7b4a8201d7eb0bbffe0115993df565ddb8bbe69d..bba7f70e5327c5644d9181fae5f1caf42d73ac3a 100644 GIT binary patch delta 495 zcmYk3%Su8~6o%K?-YPr;5pt%R8afMtAPU5Rl~!gKyPYPDgh22G6r2b`(6Gl4U#7R{ z2?D=g&Xx{*thN62uf5kf=chc`jWce)U>4bq#rF0U_jAu?mMjJ}S5o#q{1}diIm=kG z{C4wbEmx5uXjvBdFxzwkPkNrpd19SGa7@2O)Ga!yLj6M2tol0dm8hO{ z`Bf*&MgG@~8?2=3F2KV!oM6#-8>G+hsP4cXNDp(D #include - #include -#include -#include -#include -#include -namespace xe { -struct UniformBuffer { - alignas(16) glm::mat4 projectionView{1.f}; - alignas(4) glm::vec3 lightDirection = glm::normalize(glm::vec3{-1.f, 3.f, 1.f}); -}; - -struct PushConstant { - alignas(16) glm::mat4 modelMatrix{1.f}; - alignas(16) glm::mat4 normalMatrix{1.f}; -}; +namespace app { FirstApp::FirstApp() : xeEngine{WIDTH, HEIGHT, "Hello, Vulkan!"} { loadGameObjects(); @@ -36,53 +24,23 @@ FirstApp::~FirstApp() {} void FirstApp::run() { - std::unique_ptr simpleRenderSystem = xeEngine.createRenderSystem( - "res/shaders/simple_shader.vert.spv", - "res/shaders/simple_shader.frag.spv", - sizeof(PushConstant), - sizeof(UniformBuffer)); + SimpleRenderer renderer{xeEngine}; + + xeEngine.getCamera().setViewTarget(glm::vec3(-1.f, -2.f, 20.f), glm::vec3(0.f, 0.f, 2.5f)); - XeCamera camera{}; - camera.setViewTarget(glm::vec3(-1.f, -2.f, 20.f), glm::vec3(0.f, 0.f, 2.5f)); - - auto viewerObject = XeGameObject::createGameObject(); + auto viewerObject = xe::XeGameObject::createGameObject(); KeyboardMovementController cameraController{}; - auto currentTime = std::chrono::high_resolution_clock::now(); + while (xeEngine.poll()) { - while (!xeEngine.getWindow().shouldClose()) { - glfwPollEvents(); - - auto newTime = std::chrono::high_resolution_clock::now(); - float frameTime = std::chrono::duration(newTime - currentTime).count(); - currentTime = newTime; + float frameTime = xeEngine.getFrameTime(); cameraController.moveInPlaneXZ(xeEngine.getWindow().getGLFWwindow(), frameTime, viewerObject); - camera.setViewYXZ(viewerObject.transform.translation, viewerObject.transform.rotation); - - float aspect = xeEngine.getRenderer().getAspectRatio(); - camera.setPerspectiveProjection(glm::radians(50.f), aspect, 0.1f, 100.f); + xeEngine.getCamera().setViewYXZ(viewerObject.transform.translation, viewerObject.transform.rotation); if(xeEngine.beginFrame()) { - - PushConstant pc{}; - pc.modelMatrix = gameObjects[0].transform.mat4(); - pc.normalMatrix = gameObjects[0].transform.normalMatrix(); - - UniformBuffer ubo{}; - ubo.projectionView = camera.getProjection() * camera.getView(); - - xeEngine.render( - *simpleRenderSystem, - gameObjects, - &pc, - sizeof(pc), - &ubo, - sizeof(ubo) - ); - + renderer.render(gameObjects, xeEngine.getCamera()); xeEngine.endFrame(); - } } @@ -91,13 +49,20 @@ void FirstApp::run() { } void FirstApp::loadGameObjects() { - std::shared_ptr xeModel = xeEngine.createModel("res/models/stanford-dragon.obj"); + std::shared_ptr xeModel = xeEngine.loadModelFromFile("res/models/stanford-dragon.obj"); - auto cube = XeGameObject::createGameObject(); - cube.model = xeModel; - cube.transform.translation = {.0f, .0f, 2.5f}; - cube.transform.scale = {.5f, .5f, .5f}; - gameObjects.push_back(std::move(cube)); + auto dragon = xe::XeGameObject::createGameObject(); + dragon.model = xeModel; + dragon.transform.translation = {.0f, .0f, 2.5f}; + dragon.transform.scale = {.5f, .5f, .5f}; + gameObjects.push_back(std::move(dragon)); + + auto dragon2 = xe::XeGameObject::createGameObject(); + dragon2.model = xeModel; + dragon2.transform.translation = {5.0f, .0f, -1.5f}; + dragon2.transform.rotation.y = glm::radians(90.f); + dragon2.transform.scale = {.35f, .35f, .35f}; + gameObjects.push_back(std::move(dragon2)); } } \ No newline at end of file diff --git a/src/first_app.hpp b/src/first_app.hpp index 081113d..d8942ab 100755 --- a/src/first_app.hpp +++ b/src/first_app.hpp @@ -7,11 +7,9 @@ #include #include -namespace xe { +namespace app { class FirstApp { public: - static constexpr int WIDTH = 800; - static constexpr int HEIGHT = 600; FirstApp(); ~FirstApp(); @@ -22,10 +20,14 @@ class FirstApp { void run(); private: + + static constexpr int WIDTH = 800; + static constexpr int HEIGHT = 600; + void loadGameObjects(); - XeEngine xeEngine; + xe::XeEngine xeEngine; - std::vector gameObjects; + std::vector gameObjects; }; } \ No newline at end of file diff --git a/src/keyboard_movement_controller.cpp b/src/keyboard_movement_controller.cpp index 6782709..325693e 100644 --- a/src/keyboard_movement_controller.cpp +++ b/src/keyboard_movement_controller.cpp @@ -4,9 +4,9 @@ #include #include -namespace xe { +namespace app { -void KeyboardMovementController::moveInPlaneXZ(GLFWwindow* window, float dt, XeGameObject& gameObject) { +void KeyboardMovementController::moveInPlaneXZ(GLFWwindow* window, float dt, xe::XeGameObject& gameObject) { glm::vec3 rotate{0}; if(glfwGetKey(window, keys.lookRight) == GLFW_PRESS) rotate.y += 1.f; if(glfwGetKey(window, keys.lookLeft) == GLFW_PRESS) rotate.y -= 1.f; diff --git a/src/keyboard_movement_controller.hpp b/src/keyboard_movement_controller.hpp index b90d361..b3e3a15 100644 --- a/src/keyboard_movement_controller.hpp +++ b/src/keyboard_movement_controller.hpp @@ -4,7 +4,7 @@ #include "xe_window.hpp" #include -namespace xe { +namespace app { class KeyboardMovementController { public: @@ -21,7 +21,7 @@ namespace xe { int lookDown = GLFW_KEY_DOWN; }; - void moveInPlaneXZ(GLFWwindow* window, float dt, XeGameObject& gameObject); + void moveInPlaneXZ(GLFWwindow* window, float dt, xe::XeGameObject& gameObject); KeyMappings keys{}; float moveSpeed{3.f}; diff --git a/src/main.cpp b/src/main.cpp index 30b64d9..fa0804d 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,7 @@ #include int main() { - xe::FirstApp app{}; + app::FirstApp app{}; try { app.run(); diff --git a/src/simple_renderer.cpp b/src/simple_renderer.cpp new file mode 100644 index 0000000..b4c115a --- /dev/null +++ b/src/simple_renderer.cpp @@ -0,0 +1,26 @@ +#include "simple_renderer.hpp" + +namespace app { + +SimpleRenderer::SimpleRenderer(xe::XeEngine &xeEngine) + : xeRenderSystem{xeEngine, "res/shaders/simple_shader.vert.spv", "res/shaders/simple_shader.frag.spv", sizeof(PushConstant), sizeof(UniformBuffer)} {}; + +void SimpleRenderer::render(std::vector &gameObjects, xe::XeCamera &xeCamera) { + + UniformBuffer ubo{}; + ubo.projectionView = xeCamera.getProjection() * xeCamera.getView(); + xeRenderSystem.loadUniformObject(&ubo, sizeof(ubo)); + + for(auto &obj : gameObjects) { + PushConstant pc{}; + pc.modelMatrix = obj.transform.mat4(); + pc.normalMatrix = obj.transform.normalMatrix(); + xeRenderSystem.loadPushConstant(&pc, sizeof(pc)); + xeRenderSystem.render(obj); + } + + xeRenderSystem.stop(); + +} + +} \ No newline at end of file diff --git a/src/simple_renderer.hpp b/src/simple_renderer.hpp new file mode 100644 index 0000000..22ba0b4 --- /dev/null +++ b/src/simple_renderer.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include "xe_render_system.hpp" +#include + +namespace app { + +struct UniformBuffer { + alignas(16) glm::mat4 projectionView{1.f}; + alignas(4) glm::vec3 lightDirection = glm::normalize(glm::vec3{-1.f, 3.f, 1.f}); +}; + +struct PushConstant { + alignas(16) glm::mat4 modelMatrix{1.f}; + alignas(16) glm::mat4 normalMatrix{1.f}; +}; + +class SimpleRenderer { + + public: + + SimpleRenderer(xe::XeEngine &xeEngine); + + ~SimpleRenderer() {}; + + SimpleRenderer(const SimpleRenderer&) = delete; + SimpleRenderer operator=(const SimpleRenderer&) = delete; + + void render(std::vector &gameObjects, xe::XeCamera &xeCamera); + + private: + xe::XeRenderSystem xeRenderSystem; + +}; + +} \ No newline at end of file