NarcEngine 0.1.1
C++ Vulkan game engine
 
Loading...
Searching...
No Matches
FrameHandler.h
1//
2// Created by theoh on 3/10/2025.
3//
4#pragma once
5
6#include <vulkan/vulkan.h>
7
8#include "CommandPool.h"
9#include "DescriptorPool.h"
10#include "buffers/UniformBuffer.h"
11
12namespace narc_engine {
13 class DeviceHandler;
14
15 class FrameHandler : public DeviceComponent
16 {
17 friend class MultiFrameManager;
18
19 public:
20 FrameHandler();
21 ~FrameHandler();
22
23 GETTER CommandPool* getCommandPool() const { return m_commandPool.get(); }
24
25 GETTER VkSemaphore getImageAvailableSemaphore() const { return m_imageAvailableSemaphore; }
26 GETTER VkSemaphore getRenderFinishedSemaphore() const { return m_renderFinishedSemaphore; }
27 GETTER VkFence getInFlightFence() const { return m_inFlightFence; }
28
29 GETTER UniformBuffer* getUniformBuffer() const { return m_uniformBuffer.get(); }
30 GETTER const std::vector<VkDescriptorSet>& getDescriptorSets() const { return m_descriptorSets; }
31
32 private:
33 std::unique_ptr<CommandPool> m_commandPool;
34
35 VkSemaphore m_imageAvailableSemaphore;
36 VkSemaphore m_renderFinishedSemaphore;
37 VkFence m_inFlightFence;
38
39 std::unique_ptr<UniformBuffer> m_uniformBuffer;
40
41 std::vector<VkDescriptorSet> m_descriptorSets;
42
43 void addDescriptorSets(const VkDescriptorSet descriptorSet) { m_descriptorSets.push_back(descriptorSet); }
44 };
45} // narc_engine
Definition CommandPool.h:10
Definition DeviceHandler.h:11
Definition UniformBuffer.h:8