Files
OpenVulkano/openVulkanoCpp/Vulkan/UiRenderer.hpp
2021-07-31 01:59:11 +02:00

43 lines
864 B
C++

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#pragma once
#include "RenderPass.hpp"
#include "Scene/UI/UI.hpp"
#include <vulkan/vulkan.hpp>
namespace openVulkanoCpp::Vulkan
{
class Context;
class UiRenderer
{
vk::Device device;
RenderPass uiRenderPass;
vk::DescriptorPool descriptorPool;
Scene::UI::Ui* ui;
public:
UiRenderer() = default;
UiRenderer(Context* context) { Init(context); }
~UiRenderer() { if (descriptorPool) Close(); }
void Init(Context* context);
void BeginUiFrame() const;
void DrawUiFrame(vk::CommandBuffer& cmdBuffer);
void Close();
void SetActiveUi(Scene::UI::Ui* ui) { this->ui = ui; }
Scene::UI::Ui* GetActiveUi() { return ui; }
};
}