diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-19 21:28:41 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-19 21:28:41 -0400 |
commit | 8cc0b081ef0188f850814b2af2cb077583eb9f2d (patch) | |
tree | f90ba2da50c91f596672730706440149fecb2393 /engine/xe_render_system.hpp | |
parent | temp patch (diff) | |
download | minecraftvulkan-8cc0b081ef0188f850814b2af2cb077583eb9f2d.tar.gz minecraftvulkan-8cc0b081ef0188f850814b2af2cb077583eb9f2d.tar.bz2 minecraftvulkan-8cc0b081ef0188f850814b2af2cb077583eb9f2d.zip |
finish refactor
Diffstat (limited to '')
-rw-r--r-- | engine/xe_render_system.hpp | 32 |
1 files changed, 13 insertions, 19 deletions
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 <vulkan/vulkan.h> #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 <memory> @@ -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<XeGameObject> &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> xePipeline; std::vector<std::unique_ptr<XeBuffer>> uboBuffers; |