// SPDX-FileCopyrightText: 2023 Joshua Goins // SPDX-License-Identifier: GPL-3.0-or-later #pragma once #include #include #include #include #include #include #include #include "camera.h" #include "device.h" #include "drawobject.h" #include "scene.h" class ImGuiPass; struct ImGuiContext; class BaseRenderer; /// Render 3D scenes made up of FFXIV game objects class RenderManager { public: RenderManager(GameData *data); bool initSwapchain(VkSurfaceKHR surface, int width, int height); void resize(VkSurfaceKHR surface, int width, int height); void destroySwapchain(); DrawObject addDrawObject(const physis_MDL &model, int lod); void reloadDrawObject(DrawObject &model, uint32_t lod); Texture addGameTexture(VkFormat format, physis_Texture gameTexture); void render(const std::vector &models); VkRenderPass presentationRenderPass() const; Camera camera; Scene scene; ImGuiContext *ctx = nullptr; Device &device(); VkSampler defaultSampler(); private: void updateCamera(Camera &camera); void initBlitPipeline(); std::array m_commandBuffers; VkRenderPass m_renderPass = VK_NULL_HANDLE; VkPipeline m_pipeline = VK_NULL_HANDLE; VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE; VkDescriptorSetLayout m_setLayout = VK_NULL_HANDLE; VkSampler m_sampler = VK_NULL_HANDLE; VkDescriptorSet m_descriptorSet = VK_NULL_HANDLE; std::vector m_framebuffers; ImGuiPass *m_imGuiPass = nullptr; Device *m_device = nullptr; BaseRenderer *m_renderer = nullptr; GameData *m_data = nullptr; };