vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
ABase.hpp
Go to the documentation of this file.
1///
2/// @file ABase.hpp
3/// @brief This file contains the ARenderSystemBase class
4/// @namespace ven
5///
6
7#pragma once
8
12
13namespace ven {
14
15 ///
16 /// @class ARenderSystemBase
17 /// @brief Abstract class for render system base
18 /// @namespace ven
19 ///
21
22 public:
23
24 explicit ARenderSystemBase(Device& device) : m_device{device} {}
25 virtual ~ARenderSystemBase() { vkDestroyPipelineLayout(m_device.device(), m_pipelineLayout, nullptr); }
26
31
32 virtual void render(const FrameInfo &frameInfo) const = 0;
33
34 protected:
35
36 void createPipelineLayout(VkDescriptorSetLayout globalSetLayout, uint32_t pushConstantSize);
37 void createPipeline(VkRenderPass renderPass, const std::string &shadersVertPath, const std::string &shadersFragPath, bool isLight);
38
39 [[nodiscard]] Device& getDevice() const { return m_device; }
40 [[nodiscard]] VkPipelineLayout getPipelineLayout() const { return m_pipelineLayout; }
41 [[nodiscard]] const std::unique_ptr<Shaders>& getShaders() const { return m_shaders; }
42
43 std::unique_ptr<DescriptorSetLayout> renderSystemLayout;
44
45 private:
46
48 VkPipelineLayout m_pipelineLayout{nullptr};
49 std::unique_ptr<Shaders> m_shaders;
50
51
52 }; // class ARenderSystemBase
53
54} // namespace ven
This file contains the FrameInfo class.
This file contains the DescriptorSetLayout class.
This file contains the Shader class.
Abstract class for render system base.
Definition ABase.hpp:20
Device & getDevice() const
Definition ABase.hpp:39
ARenderSystemBase(const ARenderSystemBase &)=delete
void createPipelineLayout(VkDescriptorSetLayout globalSetLayout, uint32_t pushConstantSize)
Definition base.cpp:3
ARenderSystemBase(ARenderSystemBase &&)=delete
VkPipelineLayout getPipelineLayout() const
Definition ABase.hpp:40
ARenderSystemBase & operator=(const ARenderSystemBase &)=delete
std::unique_ptr< DescriptorSetLayout > renderSystemLayout
Definition ABase.hpp:43
ARenderSystemBase(Device &device)
Definition ABase.hpp:24
std::unique_ptr< Shaders > m_shaders
Definition ABase.hpp:49
void createPipeline(VkRenderPass renderPass, const std::string &shadersVertPath, const std::string &shadersFragPath, bool isLight)
Definition base.cpp:35
const std::unique_ptr< Shaders > & getShaders() const
Definition ABase.hpp:41
ARenderSystemBase & operator=(ARenderSystemBase &&)=delete
VkPipelineLayout m_pipelineLayout
Definition ABase.hpp:48
virtual ~ARenderSystemBase()
Definition ABase.hpp:25
virtual void render(const FrameInfo &frameInfo) const =0
Class for device.
Definition Device.hpp:35
VkDevice device() const
Definition Device.hpp:54